![]() PSPathFileList.ForEach(AddressOf CheckFiles) Private Shared Sub ConvertToPDF(ByVal PSPathFileList As List(Of String), _īyVal WaitForExit As Boolean, ByVal DeletePS As Boolean) Basically you write the options and file names to a text file then use that file as an argument to Ghostscript. But it illustrates the concept if you can wade through it. ![]() Sorry it's in VB.net and I don't really have time to convert. This uses a list of PDF or PS files to create one PDF. ObjCAcroPDDocDestination.save 1, strSaveAs 'Save it as a new name If objCAcroPDDocDestination.InsertPages(objCAcroPDDocDestination.GetNumPages - 1, objCAcroPDDocSource, 0, objCAcroPDDocSource.GetNumPages, 0) Then 'Open the source document that will be added to the destinationįor i = LBound(arrFiles) 1 To UBound(arrFiles) 'Open each subsequent PDF that you want to add to the original ObjCAcroPDDocDestination.Open (arrFiles(LBound(arrFiles))) 'open the first file ![]() 'Open Destination, all other documents will be added to this and saved with Set objCAcroPDDocSource = CreateObject("AcroExch.PDDoc") Set objCAcroPDDocDestination = CreateObject("AcroExch.PDDoc") Public Function MergePDFs(arrFiles() As String, strSaveAs As String) As Booleanĭim objCAcroPDDocDestination As Acrobat.CAcroPDDocĭim objCAcroPDDocSource As Acrobat.CAcroPDDoc If bSuccess = False Then MsgBox "Failed to combine all PDFs", vbCritical, "Failed to Merge PDFs"ĭoCmd.RunSQL "delete from scantemp" 'delete all paths from table scantemp after converted it to pdf StrNPDF = CurrentProject.Path
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |