LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Print Report.VI PDF Problem

I have a standard report which I print to a PDF (PDF Creator). I am facing a problem. When I issue the command to print the report, the VI executes fine, the error cluster is fine ... but the PDF itself is not created ... There is some delay in writing the PDF, but shouldn't the VI be running for as long as the PDF is being created ? Or does it lose control once it transfers the data to the printer ?

The PDF is created after few seconds ... Having a delay works but I don't want to hardcode it ... The other option is to see if the file exists or not and loop till it is created ....

Any better suggestions ?


Message Edited by Maximus00 on 09-26-2006 08:05 AM


Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 6
(3,873 Views)
Maximums00,

I thnk you are on to your best options.  Once you send a command to print to the OS, the OS takes the data and prints it.  The application that sends the command to print does not wait for the printing to actually occur.  You will notice this behavior if you print a web page or a Word document.  There may be Windows API stuff you could do to hook in to see whether a job in the print queue is done but I am not sure. 


Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
Message 2 of 6
(3,853 Views)
Doug

Thanks for your reply. Just before I begin to process the PDF file, I create a loop to check the error cluster. If the status is T, then I keep looping it till one is created or times out in 10 seconds and usually it does create a PDF in 10 secs. So that should hopefully solve the problem.

Kudos are the best way to say thanks 🙂
0 Kudos
Message 3 of 6
(3,851 Views)
Yeah, That seems like a decent workaround.  While searching I found this old thread which suggests " if you disable the spool function of your printer (in XP: advanced printer properties/ print directly to printer) Labview will wait until the print job is done." but this requires administrator rights on the printer.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
Message 4 of 6
(3,849 Views)
Can I do the same for Win 2000 machines ? Thanks !

Kudos are the best way to say thanks 🙂
0 Kudos
Message 5 of 6
(3,784 Views)
Maximus,

I'm not much of an expert on Windows or printers, but from a google search of "spool function" + 2000, there are some documents from various printer manufacturers, it seems this function may be part of the specific printer driver API, but I'm not positive.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 6 of 6
(3,764 Views)