05-20-2016 06:33 AM
Hello!
I would like to know what is the simplest way to save html reports as pdf files using PDFCreator version 2.1
Or any other way to do it..
thank you very much,
Solved! Go to Solution.
05-20-2016 06:52 AM
05-20-2016 10:00 AM - edited 05-20-2016 10:01 AM
Here is some code from the NI Developer Community
Creating a PDF Document in LabVIEW
These set of LabVIEW VIs allow you to print a PDF by calling the open source PDFCreator application through ActiveX. As an added feature, unlike most PDF creator applications in this example there is no Save As dialog box that appears it is all done programmatically. The top level VI in the example is Print PDF Using PDFCreator ActiveX inside the attached LLB.
https://decibel.ni.com/content/docs/DOC-4552
02-28-2018 10:10 AM
This version is now dated and PDF Creator has changed the API.
What's crucial, and not well documented, is that the print must be fired off before calling the WaitForJob else the NextJob will never get a valid reference. And the error will propogate and not call the ReleaseCom only to hang LabVIEW.
The code can also be written using ActiveX.
There's some fun code attached using the WebBrowser .NET control to fire a print for the html file. I found the Report Generator VIs are based on IE and didn't render the PDF very neatly.
LabVIEW: 2017 & 2012 in the zip file
PDF Creator: 2.3.0.103 (for 3.x the API changed slightly again)
The .NET constructor is linked to the PDFCreator.exe.
P.S. Check the PDF installation directory for sample scripts. Lots of info there too.
Lavag: Convert File Extension (Path).vi
Enjoy.
04-06-2018 01:31 PM
Your instructions got me 80-90% of the way there, thanks. But I could not link to PDFCreator.exe.
I found the following worked for me with ver3.2.0.
Maybe this will help the next person.
07-10-2018 11:04 AM
Agreed with the very first response, as long PDFCreator is a simple pdf printer, to send the file to print is everything you need to do in order to get the conversion done 🙂 But as far as I remember this very software has its shortcomings when it comes to LabVIEW, so some reports might well be exported with no proper scaling and fonts. And the very point of that is yo need to fix these things manually if they occurred. It's easy if you have editing tools like Acrobat Pro, but if not so, there's a cheaper one https://w9.pdffiller.com quite similar to that as we speak about the features, as well as has a free trial period long enough
01-22-2019 08:07 PM
Hi
I am using PDFCreator to save my html report in pdf format, but every-time when LabVIEW save the HTML page as pdf the document contains the temporary file path in the footer.
how to avoid this and the link you have mentioned is expired i guess.
please give your suggestion,
Thanks in advance.
01-22-2019 08:10 PM
Hi
I am using PDFCreator to save my html report in pdf format, but every-time when LabVIEW save the HTML page as pdf the document contains the temporary file path in the footer.
how to avoid this and the link you have mentioned is expired i guess.
please give your suggestion,
Thanks in advance.
01-28-2019 09:36 AM
Hi,
since the link to the example doesn't work anymore, does somebody have any suggestions about how to use ActiveX to programmatically set the file path when printing to PDF, please?
Kind regards,
Alessia
01-28-2019 10:32 AM
Try the attached files, sorry it's been a while.
You must have the paid version of PDFCreator installed for this to work. It does not cost much.
This works with 3.2.0 version. Not tested on other versions.
Barry