From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing options window

Solved!
Go to solution

I have front panel ("main.vi"), there are graphs, graphs palette, two timestamps, two string control, and button "Print". After the press "Print" button, there appear a new panel ("Print option.vi"), there user can put some printing option ( in block diagram i use layout options). Then he press Print (in "Print option.vi"), and this vi closed, and give cluster "layout options" to main.vi. In main.vi I set false visible of string controls, button "Print" (because I didn`t need them in printing). Then print front panel using "Easy Print VI Panel or Documentation.vi" with my layout options. After that I again set true visible of string controls, button "Print".
This is my algorithm to print front panel. So, there are some questions.
Firstly, I want to see preview front panel before printing in "Print option.vi". There are http://forums.ni.com/t5/LabVIEW/print-preview/m-p/1187669#M513620 solution is bad, I don`t want use another programm to print. In the LabVIEW 2010, I can see preview by "File-Print-Preview", but i didn`t find how use this option programmly. Is it possible?
And second question. I put layout options orientation landscape, and top margins 5cm, but then print there is no effect. It is print as portrait and 1 cm margins. Why?

0 Kudos
Message 1 of 7
(2,777 Views)

I am not aware of a print preview feature within LabVIEW. A suggestion to avoid using another application to generate the preview would be to install a PDF "printer" and used it's output as a preview function. You could use an application such as PDF Creator.

0 Kudos
Message 2 of 7
(2,773 Views)

I wrote: "I don`t want use another programm to print."

Maybe somebody know....

0 Kudos
Message 3 of 7
(2,766 Views)

I did see that.  But you have no alternative.

 

 

0 Kudos
Message 4 of 7
(2,763 Views)
Solution
Accepted by topic author rusl

Actually there is sort of an alternative. The actual front panel that you try to print is in fact the preview! Smiley Very Happy

 

Another option that is actually fairly easy to implement is to retrieve the front panel image through a VI server method and display it in a picture control in your dialog. I don't have a ready made print dialog with preview handy right now, but attached snipped should give you an idea how it could be done.

Panel Preview.png

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 7
(2,756 Views)

Could the code capture tool be modified to capture the front panel?

 

It's been so long since I looked at it, I can't remember it's block diagram...  Maybe that could also be an alternative, but it does not provide a preview....

 

 

0 Kudos
Message 6 of 7
(2,750 Views)

@Ray.R wrote:

Could the code capture tool be modified to capture the front panel?

 

It's been so long since I looked at it, I can't remember it's block diagram...  Maybe that could also be an alternative, but it does not provide a preview....


It doesn't have to be modified. It can already capture the FP. Not only that, but it uses an API which other people can use if they want to. It can be found here: Code Capture Tool

 

That said, I don't think there's any point to installing it in this case. As Rolf pointed out, a simple call to Get Panel Image should be enough (although I'm not sure how much it will help in this case, because for the preview to work the controls need to be hidden first).

 

The proper solution is probably to create another VI which will only be used for printing (this can have simpler graphs with mostly white background, etc.). Then, you can simply grab the panel of that VI and also print it.

 

 

P.S. Ray, you probably should use the CCT, as it makes the process of sharing images a lot easier (and if you create a snippet with a reference or a local in it, it won't mangle it like LV does).


___________________
Try to take over the world!
Message 7 of 7
(2,736 Views)