Copy link to clipboard
Copied
Hello,
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:
- Is it possible to use the Adobe VBA SDK to access the "Create - > PDF from file" that is available from the file menu of adobe
- Is it possible to use the print shell command to print the file and automaticly select the "Adobe PDF" printer.
- Is it possible to use a shell command to access the "Adobe PDF" printer or Adobe Acrobat 2017 app directly to print the image file.
Win 10
Adobe Acrobat 2017 (pro)
Regards,
Daniel
1 Correct answer
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 = AcroExchAV
...
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hello,
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,
George
Copy link to clipboard
Copied
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.

