So my IT department has replaced Acrobat with Foxit over the weekend and I need to change some VBA scripts that has been using the Acrobat API to save png files as pdfs.
It looked like a walk in the park according to the API reference guide provided by the IT department
It even have a convenient section on Converting non-PDF to PDF:
phCreator.ConvertToPDF("D:\image.png", " D:\image.png.pdf")
Easy to understand: Provide source and destination. But that was for Foxit 9 and the version that was installed on my computer is Foxit 10 and the sample code does not work. The API for Foxit 10 is descriped in this guide:
This guide also has a section named Converting non-PDF to PDF but it looks like it does something completely different, opening a guide that convert Excel sheets to PDFs.
Looking through the object browser in Excel I am unable to figure out how to transform a PNG to pdf with Foxit 10. do anyone have a solution?
You have identified the updated version of Foxit as using Version 10 of Phantom API and actually had researched Prior examples so essentially had found all the info you needed without support from I.T dept :-)
I simply pointed out that the section:-
"Combining several documents to a PDF"
Dim phCreator As FoxitPhantomPDF.Creator
Set phCreator = CreateObject("FoxitExch.Creator")
Dim nCombinedCnt As Integer
nCombinedCnt = phCreator.CombineFiles("D:\image1.png|image2.png", "D:\combineFiles_files.pdf",
COMBINE_ADD_CONTENTS)
Call phCreator.CombineFiles("D:\CombineFiles", "D:\combineFiles_folder.pdf",
COMBINE_ADD_CONTENTS)
Note:The path "D:\CombineFiles" is a folder which contains several files that are supported.
would be a good starting point for multiple PNGs in one PDF. The alternative for a single PNG on one or more pages is given as a "Watermark" example.