11-14-2012 06:01 AM - edited 11-14-2012 06:02 AM
Hi!
My customers had problems with print.panel to printer method in windows 7 64-bit so I made a simple standalone application which prints a VI panel to default printer (zipped project is attached). I'm using Developer Suite with Labview 12.0f3 (32 bit) on Windows XP. The application has been deployed to computers running windows 7 (64 bit) and windows XP (32 bit) and tested with different printers: local and network. There is a list of printers where the application does not print the panel on windows 7 (64 bit): HP DeskJet D4360, HP DeskJet 5550, HP DeskJet 5652, HP Photosmart C3180 and PDF Complete (an application which converts document to PDF). The application does not report any error, everything seems normal. The document is sent to the printer, usually printer heads start to move for a moment, in one case the paper is taken from the drawer and that's all. There's no need to say that all this printers work normally with Winword, Notepad, Excel, ...
My application prints a VI panel in Windows 7 (64 bit) without any problems if I use: Canon IR2200, Toshiba e-STUDIO 2500c, Samsung ML-2240, HP LaserJet 5L, HP LaserJet P2050, PDFcreator, ....
ALL printers, including HP DeskJet models, work normally in Windows XP (32 bit).
According to the post here the printer margins in my application are set to a value of 3 cm because it might solve the problem but it does not help.
Any other suggestion?
Ljubo.
11-15-2012 04:27 AM
Dear Ljubo!
Thank you for contacting us. I could reproduce your problem with LabVIEW 2012 (32bit), Windows 7 (64bit) and PDF Complete. As I've found, this issue is caused by the inconsistency in the way Windows 7 handles registry keys and access to the default printer in 32 bit and 64 bit versions. The problem is being addressed and fixed in a later version of LabVIEW. In the meantime, there is a workaround you can use, report generation VIs. This worked fine for me. Please try this Snippet:
Please get back to me with the result. We can also explore other options if this fails.
Kind regards:
Andrew Valko
National Instruments
11-16-2012 06:17 AM
Hi, Andrew!
Thanks! I'm glad you could reproduce my problem. The workaround you suggest works on my Windows 7 computer. I've sent the application to my customers and now I'm excpecting their answers.
After checking the code of my main project again I found out that I use two different functions in my main project and in the project I have posted on the forum as an example. I have to apologize for that. In my main project I use Print Panel to Printer.VI which calls (Call Library function node) a function VIPrintPanelToPrinter. In my example I use Invoke node to invoke a method Print:Panel to Printer. The result is the same: it doesn't work in Windows 7 64 bit. But the functionality is not the same: calling library function let user open a printer dialog. User can select a printer and change settings of the printer.
Regards,
Ljubo.
11-19-2012 03:41 AM
Dear Ljubo!
I'm glad that it has worked for you, I hope your clients will have the same success. As I've found, incompatible printers on Windows 7 64bit is a known issue, and will hopefully be fixed in a later version of LabVIEW. I'll be sure to include your input (which printers worked and which did not) on the case.
Also, it seems to me that both the Invoke Node and the Library Call use the same function to accomplish printing; however, the Node sets the "show print dialog" input automatically to false, hence the lack of printing options (this makes sense from a programming perspective, since if we want to print programmatically, additional user input at every print job is most likely unwanted). Please get back to me when your customer has results, if something is still not functioning, we might explore some other workarounds.
Kind regards:
Andrew Valko
National Instruments