I am trying to implement a prototype that is able to take a list of image files in Excel and print/convert these files to PDF.
I believe there may be some possibilities to how to implment this and am asking if anyone knows if they are practical:
Adobe Acrobat 2017 (pro)
Copy link to clipboard
I was able to determine a solution to this problem myself.
Turns out you can just open up an image file using an AVDoc object, getting the PDDoc Object from that and then using the PDDoc save method to save it to one's desired destination.
I will include a code snippet for anyone in the future.
Set AcroExchApp = CreateObject("AcroExch.App") Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc") Set AcroExchPDDoc = CreateObject("AcroExch.PDDoc") ' Open the [Filename] pdf file resp = AcroExchAVDoc.Open(filePath, "") 'Get the PDDoc associated with the open AVDoc Set AcroExchPDDoc = AcroExchAVDoc.GetPDDoc 'PDSaveFull = 1 resp = AcroExchPDDoc.Save(1, newFilename) AcroExchApp.Exit AcroExchAVDoc.Close (True) AcroExchPDDoc.Close
Thank you for this. I have been able to use it to creat a one page pdf. I am trying to create one PDF from multiple jpgs. All I have been able to get is a PDF with multiple pages that all the same page. I am not sure how to establish a second of third AVDoc. Can you provide any insight?
Thanks in Advance,
To create a second AVDoc
Set SecondAcroExchAVDoc = CreateObject("AcroExch.AVDoc")
By the way, if your files are fill-in forms, this is working as designed. Combining files with the same form field names gives multiple copies of form fields with the same name. By design, they will all have the same value. You cannot combine live forms and keep them separate.