LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include AcroPDF in executable

Dear all,

 

I would like to include the AcroPDF ActiveX (to preview generated PDF files) into my executable. If this is not possible I would like my executable to search for an available AcroPDF ActiveX (If the user has a different version for example). does anybody have a solution for this?

 

Best regards,

Jeroen

0 Kudos
Message 1 of 19
(3,475 Views)

I used to do something like this but quickly realized that it's not clean and it's a big hassle.  I now just use the system exec VI with the following command and let the OS decide which program to view the file:

 

cmd /c "<path to pdf>"

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 19
(3,446 Views)

@aputman wrote:

I used to do something like this but quickly realized that it's not clean and it's a big hassle.  I now just use the system exec VI with the following command and let the OS decide which program to view the file:

 

cmd /c "<path to pdf>"


Another option is to use "Open a Document on Disk.vi". It uses the same method.

 

C:\Program Files (x86)\National Instruments\LabVIEW 201X\vi.lib\Platform\browser.llb\Open a Document on Disk.vi

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 19
(3,433 Views)

Hi,

 

Thank you for the replies, but I need something else. The program generates a multiple page pdf report from a test. After it has been generated I want to be able to remove selected pages from this report (and I want the user to do so). I now have a VI that loads the pdf, shows it to the user and let him/her select the pages to keep/delete. Then the final report get page numbers and is saved in the final location. See the attachment, therefor I need the report to be displayed inside my program.

 

Kind regards,

Jeroen

Capture.JPG 

 

 

0 Kudos
Message 4 of 19
(3,427 Views)

Hi Jeroen,

 

what about using preview images for that selection dialog? No need to use .NET in that VI at all…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 19
(3,423 Views)

Hello Gerd,

 

And how should I do that? I use the pdf Toolkit from Carya to create the pdf report.

 

Best regards,

Jeroen

0 Kudos
Message 6 of 19
(3,417 Views)

Hi Jeroen,

 

I don't know about that toolkit.

Does it allow to create images for each page too?

Otherwise there are (free) commandline tools to convert PDFs to images…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19
(3,412 Views)

@GerdW wrote:

Hi Jeroen,

 

I don't know about that toolkit.

Does it allow to create images for each page too?


The Toolkit allows to create a PDF document pretty similar to what you can do with the Report Generation Toolkit for Excel and/or HTML So you actually define where to put which text or image into the document and the Toolkit then generates directly the according Encapsulated Postscript format to create a valid PDF file. Pretty nifty and without the need for any .Net or ActiveX component. However the version I used doesn't have an option to also generate previews as it is not a renderer at all, so can't render the PDF document offscreen to create such a preview. And I would think that creating such a renderer in pure LabVIEW is a pretty nasty task to perform.

Rolf Kalbermatter
My Blog
Message 8 of 19
(3,401 Views)

Thank you all for the replies.

For now I will check for the plugin to be available, if so the option to preview becomes active, otherwise it will be skipped.

 

Best regards,

Jeroen

0 Kudos
Message 9 of 19
(3,395 Views)

@JeroenBK wrote:

For now I will check for the plugin to be available, if so the option to preview becomes active, otherwise it will be skipped.


I'm not so sure it will be that simple.  Using ActiveX requires property and invoke nodes to call the methods in the DLL.  If the DLL is not installed, you'll end up with broken property nodes and missing DLL errors that will render the application unusable.  If you add this functionality to your code, you should make sure that Acrobat is installed thru the use of a custom installer

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 10 of 19
(3,387 Views)