05-03-2012 05:47 AM
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?
Solved! Go to Solution.
05-03-2012 06:14 AM
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.
05-03-2012 07:49 AM
I wrote: "I don`t want use another programm to print."
Maybe somebody know....
05-03-2012 09:17 AM
I did see that. But you have no alternative.
05-03-2012 02:16 PM - edited 05-03-2012 02:17 PM
Actually there is sort of an alternative. The actual front panel that you try to print is in fact the preview!
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.
05-03-2012 02:33 PM
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....
05-04-2012 04:01 AM
@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).