LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hw can I generate XY graphs directly in a vector data format for printing ie pdf

A further question re. Printing of Graphs

There are many similar questions but none where the answers are acceptably adiquite or two or three were the link was broken,
"Developer exchange forums have been moved" and a pointer to the new site, unfort it was hard to find or guess the rest of the link.

So here is my angle on this problem;

So far I have tried;
 
Using property node: "App.  Printing.Default Printer" to select the printer to use, then
Using Report Functions to print controls;
  • New Report, to generate a new report reference
  • Set Report Orientation
  • Set Report Margins
  • Set Report Font
  • Set Report Header Text
  • Set Report Font
  • Set Report Footer Text
loop for each page
  • Set Report Footer Text,     With page number
  • Append Control Image to Report,      several times
  • New Report Page
Until the end of the last page
  • Print Report
  • Dispose Report
Initially using existing XY-Graph controls from the front panel.  These are on a page of a Tab control to hide these controls while not in use and allow them to be hidden while generating the printout.  Unfortunately when this page is hidden any graph scales set to autoscale don't, (normally don't need to and would otherwise be a waste of processor time), resulting in graph plots going off scale or becoming a line along the axis.
An issue is that what is printed appears to be read from the screen, so resolution is much lower than required for for printing, resulting in rather pixellated printed versions. These prints will usually be emailed, so tried the pdf995 "printer driver" but the resulting pdf file size is rather large.
 Currently trying Plot-XY on a much larger picture so as to get adequate resolution for printing, however suspect this will result in much larger pdf files and probably cause other problems. 

The preferred solution in this case will probably be to generate print output, instead of based on raster images (ie jpg or png), but on a vector format, maybe via postscript or directly in pdf format.

Similar graphs currently printed from Excel via pdf995 (or OpenOffice) result in files around 20 kb per page. these can be printed at any size (at least upto 64 times) without becoming pixellated, so assume these are vector based.

Currently a page with 4 XY Graph controls uses around 40 to 45 kb per page but resolution is poor and overcoming that may push file size up to 150 to 200 kb per page, and the whole job can be 50 to 100 pages.

Are there any functions to generate XY graphs directly in a vector data format preferably in pdf or via PostScript format.

Cheers
Darryl

0 Kudos
Message 1 of 4
(3,098 Views)

Hi Darryl,

I was able to reproduce the issue you were seeing, in which a report generation was taking up a large amount of space per page in a PDF utility. I found; however, using my attached VI (notice that it is set to *.png) and the CutePDF utility (free download at http://www.cutepdf.com/) I was able to get a per page size of about 10 KB. Also using the png I found that the image quality seemed to be quite high.

Please try incorporating this solution into your application and see if it reduces your file sizes.

Thanks and have a good evening!

Cheers,

Jonah
Applications Engineer
National Instruments

Jonah Paul
Marketing Manager, NI Software
0 Kudos
Message 2 of 4
(3,063 Views)
Sorry, I've been away on other jobs since posting my question, and am now just getting back into it.

Thanks Jonah for the suggestions,
We found the *.png option, and that cleaned up the "JPG noise" but dosen't change the low resolution.  I am currently toying with the idea of writing to a picture, set up to give me enough pixels for say 300 dpi or whatever and printing that.  this may be slower but shouldn't matter as it will only be used for printing.  I'll keep the existing controls for screen display.  This has the advantage that I can have different formatting (ie no background, and different colours etc more suitable for printing on paper.  Any comments suggestions etc.

CutePDF did seem to work slightly better, curiously PDF995 stopped working when CutePDF was installed and so far I cannot get both to work (short of reinstalling when I want to change), so it is harder to compare them directly

Unfort I have not been able to look at your "print_XY Graph.vi" example as no one around here has V. 8.5 yet,  (v 7.0, 8.0 and 8.2 I think it was).
Could you re compile it to an older version (Pref 7) but 8.0 would be accessable.

Cheers
Darryl

0 Kudos
Message 3 of 4
(2,969 Views)

Darryl,

Attached is my Print XY Graph.vi saved for LabVIEW 8.0 and modified to be an example of how you can use a property node to create an image of your graph and add it to your report. Note however that the Append Image to Report VI does not support *.png so I used *.bmp instead but the compression was still good enough in the CutePDF application.

Let me know if this example helps!

Cheers,

Jonah
Applications Engineer
National Instruments

Jonah Paul
Marketing Manager, NI Software
0 Kudos
Message 4 of 4
(2,938 Views)