LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PDF File Generation in LabWindows/CVI

Hi,

I'm looking for ideas on how to automatically generate multiple-page PDF documents in LabWindows/CVI.

 

The pages consist of images of panels that have automatically updated some graphs.

 

Any ideas?

Thanks,

Kirk

0 Kudos
Message 1 of 12
(11,255 Views)

Howdy Kirk,

 

Great question. You might try one of these four options:

 

  1. Install a "PDF Printer" in Windows. This is essentially a virtual Windows printer that we can print to in CVI using functions like PrintPanel, PrintTextFile, etc.
  2. Find a commandline PDF creator and call the commandline application from CVI. (See the launchexe.cws example located in the Example Finder under Comm w/External Apps » OS)
  3. Find a DLL you can call to create a PDF. (See the examples located in the Example Finder under Comm w/External Apps » Using External Code)
  4. Install a PDF creator and communicate with it through ActiveX if it has an ActiveX server.

 

Sorry I can't provide a specific recommendation for PDF software for these suggestions, but I hope it gets you going in the right direction!

Message Edited by pBerg on 02-05-2010 10:00 AM
Warm regards,

pBerg
0 Kudos
Message 2 of 12
(11,218 Views)

I am also looking for something similar.  The way I currently print is below; but this prints EACH panel separately and does not combine the pages.  I am not sure how to give it multiple panels to print, especially when I have them in tabs with only one visible at a time.

 

 

SetPrintAttribute (ATTR_PRINT_AREA_WIDTH, VAL_INTEGRAL_SCALE); SetPrintAttribute (ATTR_PRINT_AREA_HEIGHT, VAL_USE_ENTIRE_PAPER); SetPrintAttribute (ATTR_BITMAP_PRINTING, 0); SetPrintAttribute (ATTR_PRINTER_NAME, "Adobe PDF"); PrintPanel (init_panel_handle, 0, 1, VAL_FULL_PANEL, 1);

 

 

0 Kudos
Message 3 of 12
(11,245 Views)

I have been using 2 different methods with success, according to the application.

 

1. Haru Free PDF Library (a set of functions to create a PDF with various properties)

 

2. NI Report + BullZip free PDF printer (you prepare the report in memory and convert it to PDF by printing)

 

I can provide some more infomation about thier usage in case you cannot figure out how to use them.

Hope this helps, 

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 12
(11,237 Views)

It seems NI Report is only available in the Full Devl, not the Basic in which I have.

 

Haru would work, I just need a good way of getting a good quality image (print screen) of each of my tabs.

0 Kudos
Message 5 of 12
(11,196 Views)

All, 

 

I'm using an older version of Acrobat which almost solves the problem.

The trouble is that I'm not able to get multiple pages.   It seems like PrintPanel is not sending a page eject or something  like that.

 

One thing that I do is to set the panel's ATTR_TITLE to what I want acrobat to use for the file name.  Then the name is already correct in the dialog box that acrobat displays

before the file is printed .

I'm still experimenting trying to get multiple pages.

 

Thanks for the input and keep the ideas coming,

Kirk

0 Kudos
Message 6 of 12
(11,163 Views)

Hi

I'm also been experimenting to get multiple pages, have you gotten any further ?

0 Kudos
Message 7 of 12
(11,047 Views)

May I know how to use the Haru PDF library to print multiple panels into multiple pages of PDF?

0 Kudos
Message 8 of 12
(10,090 Views)

I wrote a small contribution to help understanding how to integrate HARU Pdf library into a CVI project: you can find it here.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 9 of 12
(10,083 Views)

Perhaps you can also use "libreOffice", there is a tool available which converts any "odt"-file to pdf (libreoffice has built-in pdf export) (look for 7pdf).

The file format odt is zipped xml, so you can create with you application a report, wrap it "libreOffice-style" and export it as pdf.

 

Works quite nice within my projects, and doesn't need commercial applications to be installed.

 

Peter

0 Kudos
Message 10 of 12
(10,016 Views)