LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to print a dynamic image array?

Hello.

 

I would like to print (in PDF, Excel sheet or else, then on paper) a dynamic Image Array (its number of elements can change).
I use the Report Generator tool to print in PDF, but the problem is I end having cut images in my report, since the array does not fit the printing page.
I think there is a solution with number or string arrays through Excel, but is it also possible with image arrays?
For instance, I joined, in my example, 3 arrays (choose 1 to 3 for test and also, show the layout options then choose your printer) but please have in my mind that my real structure is more complicated than this array (1 big cluster with different arrays, each one containing various number of images).


Can anyone help me?

 

Thank you in advance.

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

Good thing I looked at the code.  I think of "Image" as something I get from a Camera and display in Vision's Image Display indicator.  Your "Image" is a LabVIEW 2D Picture, and what you seem to want to print is not an Array of 2D Picture, but the Front Panel of a VI.

 

Have you thought about creating an Array of Pictures?  You mention that your real requirement is "much more complicated" -- you might want to consider creating a single Picture and programmatically "filling in" Images, Text, whatever you want in various places to programmatically create the single Picture that you want to print.

 

This sounds very "messy", however you decide to do it.  You might consider using the Report Generation Toolkit and "writing a Report", where you place Report elements into the Report and save the Report ...

 

Bob Schor

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

Bob,

 

Thank you for the clues.


You might consider using the Report Generation Toolkit and "writing a Report", where you place Report elements into the Report and save the Report ...


Can you give me an example by applying what you say in my VI?

 

And also, you mention an Array of Pictures, do you know how I could make it printable, page by page, without any cut in my content?

 

 

Thank you.

0 Kudos
Message 3 of 4
(3,496 Views)

Well, I partly managed to do a "Page-by-page".  More-or-less for "Proof of Principle", I made an HTML Report that simply printed all of the Pictures one after the other.  One "problem" I had was that there were no page breaks -- the plots just came one after another.  Another (minor) bug is that LabVIEW gave me a "File not Found" error when I tried to save the (new) HTML file, so I substituted a "View HTML in Browser and create Temporary File" (which I didn't bother to write out).

 

I do all of the "magic" with the RGT, of course.  One small piece of the magic is the sub-VI "Show Picture" -- all this does is display on a Picture Control on its Front Panel the picture you pass to it, and we then write that Front Panel to our HTML.  Pretty sneaky.

 

While this is saved in LabVIEW 2015 (and I think you are running LabVIEW 2013), it is simple enough that if you have the RGT, you should be able to reproduce it.  I've already told you the sub-VI "Show Picture" does nothing except slap the Picture input onto its Front Panel (nicely covering up the Error In and Out).  The code at the beginning is to turn your 2D arrays of pictures into 1D arrays and concatenate them so I can use a single For loop and just run them all.  I'll attach the resulting HTML file -- I'm not sure how Image Order is maintained, but that should be simple to adjust.

Report All Pictures.png

[In getting the HTML ready, I realize that it created 60 JPegs, with the HTML being "Display my JPegs" -- probably not what you want!  But the principle of iterating through a series of Pictures, getting separate Images with the RGT, and putting them somewhere, still applies.  More fiddling may be needed].

 

Bob Schor

0 Kudos
Message 4 of 4
(3,477 Views)