how to merge multiplefiles and delete this all files?

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

how to merge multiplefiles and delete this all files?

Post by vivekpatel »

Hello,
Here is my code for "Merge Multiple Files". My issue is after the operation, I need to delete the files which are merged and the files are 'inuse' for a long time so cannot delete them.

=======

Dim m_Inst As PDFXEdit.PXV_Inst = Nothing
Dim m_Inst1 As PDFXEdit.IPXV_Document = Nothing
Dim m_pxcInst As PDFXEdit.IPXC_Inst = Nothing
Dim m_nID As Integer = 0
Public Doc, Doc1 As PDFXEdit.IPXC_Document
Dim input1 As PDFXEdit.IOpInputItem
Dim Op As PDFXEdit.IOperation
Dim Input As PDFXEdit.ICabNode

For j As Int16 = 0 To gvFile.RowCount - 1
If j = 0 Then
m_nID = m_Inst.Str2ID("op.combineDocs", False)
Op = m_Inst.CreateOp(m_nID)
Input = Op.Params.Root("Input")

Dim clbk As AuthCallback = New AuthCallback()
Try
Doc = m_pxcInst.OpenDocumentFromFile("1st file", clbk)
Catch ex As Exception
Doc.Close()
Exit Sub
End Try
Input.Add().v = Doc
Try
Else
Doc1 = m_pxcInst.OpenDocumentFromFile("2nd file", clbk)
Catch ex As Exception
Doc.Close()
Exit Sub
End Try

input1 = Op.CreateInputItem(Doc1)
input1.Params.Root("PagesRange.Type").v = "All"
Input.Add().v = input1
End If
Next
resdcs.WriteToFile(strfladrs_pdf)
Doc.Close()
Doc1.Close()
My.Computer.FileSystem.DeleteDirectory("2nd files and many other files.").............this line throws error that file is in use. The file is released after about 40 secs. How do I delete this file? Is there a function to release the file which I am missing in my code?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to merge multiplefiles and delete this all files?

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

Please provide a working sample that recreates the behavior so that we can assist further.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: how to merge multiplefiles and delete this all files?

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

Please provide a working sample that recreates the behavior so that we can assist further.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply