LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Print multible panels in one printjob?

Hi!
I have to print out 3 panels - each panel is one paper. I do the hardcopy with 3xPrintPanel (..) and the result is that in the printer spooler there are 3 printjobs. Is there a possibility that I can print out the 3 panels in one printjob??

Thanks!
Thomas
0 Kudos
Message 1 of 6
(3,640 Views)
Check out this post.

http://forums.ni.com/ni/board/message?board.id=180&message.id=13686
0 Kudos
Message 2 of 6
(3,633 Views)
I found a other solution: I save the 3 panels to .bmp image files and print this files with the NI report generator. With "NIReport_AppendImageFile" I load the image file into the report and make a hardcopy. The big problem is that the quality of the image is very poor. The image of the panel is very blurred. I played around with resizing the panel and the image but this would not end in a acceptable quality.
Do anybody know what I can do to improove the quality?

Thanks
Thomas
0 Kudos
Message 3 of 6
(3,608 Views)
Thomas,

My guess is that the bitmaps are becoming pixelated due to the differences in resolution between the screen and the printer, requiring bitmaps to become stretched in order to print them. You can mitigate this by starting out with larger bitmaps. To do this, call GetScaledPanelDisplayBitmap, instead of GetPanelDisplayBitmap, and experimenting with different sizes. This should improve the quality of the bitmap, although I'm not sure what impact it will have in how you're combining the 3 bitmaps in a single report.

By the way, have you tried printing the panels directly using ATTR_EJECT_AFTER? It should be a lot easier.

Luis
0 Kudos
Message 4 of 6
(3,604 Views)
Luis, thanks for your reply!

The panel size in the .uir is 3437x2280 (HxW). If I print it out with PrintPanel and VAL_USE_ENTIRE_PAPER for width and VAL_INTEGRAL_SCALE for height it fits exactly on the A4 paper size.

I also thought about ATTR_EJECT_AFTER and tried it. The code looks like

SetPrintAttribute (ATTR_EJECT_AFTER, 0);
PrintPanel (PnlPrn1ID, "", 1, VAL_FULL_PANEL, 1);
PrintPanel (PnlPrn2ID, "", 1, VAL_FULL_PANEL, 1);
SetPrintAttribute (ATTR_EJECT_AFTER, 1);

but the result is that just the last page (PnlPrn2ID) is printed out on printer. Did I use the right commands?

For my company it´s absolutely necessary that multible pages will be printed out in one printjob. Now I´m playing around with ActiveX and Word but at the moment I´m just able to start Word from my application. This is the first time using ActiveX and I have no experiences.

Thomas
0 Kudos
Message 5 of 6
(3,586 Views)
Thomas,

The reason you are seeing only the second panel when you print both of them with EJECT_AFTER is because you are not setting ATTR_PRINT_AREA_HEIGHT, ATTR_PRINT_AREA_WIDTH, ATTR_XOFFSET, and ATTR_YOFFSET print attributes. By default, these are set such that each image will take up the entire size of the paper. If you need to fit multiple images in a single sheet of the paper, you will need to change these defaults. For example:

SetPrintAttribute (ATTR_EJECT_AFTER, 0);

SetPrintAttribute (ATTR_XOFFSET, VAL_CENTER_ON_PAPER);
SetPrintAttribute (ATTR_YOFFSET, 0);
SetPrintAttribute (ATTR_PRINT_AREA_HEIGHT, 1000); // units are mm/10
SetPrintAttribute (ATTR_PRINT_AREA_WIDTH, VAL_USE_ENTIRE_PAPER);
PrintPanel (PnlPrn1ID, "", 1, VAL_FULL_PANEL, 1);

SetPrintAttribute (ATTR_XOFFSET, VAL_CENTER_ON_PAPER);
SetPrintAttribute (ATTR_YOFFSET, 1100); // 1000 plus a 10 milimeter gap
SetPrintAttribute (ATTR_PRINT_AREA_HEIGHT, 1000);
SetPrintAttribute (ATTR_PRINT_AREA_WIDTH, VAL_USE_ENTIRE_PAPER);
PrintPanel (PnlPrn2ID, "", 1, VAL_FULL_PANEL, 0); // don't bring up the dialog a 2nd time

SetPrintAttribute (ATTR_EJECT_AFTER, 1);

Of course, you'd have to change these values based on your paper size and the panel sizes. It might take some experimentation to produce the best outcome.

Luis
0 Kudos
Message 6 of 6
(3,581 Views)