Print Page | Close Window

Wait for print to complete

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3157
Printed Date: 28 Jan 26 at 10:35AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Wait for print to complete
Posted By: Natalia
Subject: Wait for print to complete
Date Posted: 10 Aug 15 at 5:01PM
Hello,

We noticed that PrintDocument() method returns before print operation is complete, and are looking for the correct way to wait for print to finish.
RequestPrinterStatus(300) returns 8208 during print, and 0 when after print succeeds.
Where could we find the description of possible values returned by RequestPrinterStatus?
What is 8208 and what values would be returned if error occurs?

Thanks,
Natalia.



Replies:
Posted By: Ingo
Date Posted: 10 Aug 15 at 8:41PM
Hi Natalia,

the function RequestPrinterStatus is a bit experimental.
In the description you can read that there's no guarantee that it works with all printer and all printer driver:
http://www.debenu.com/docs/pdf_library_reference/RequestPrinterStatus.php" rel="nofollow - http://www.debenu.com/docs/pdf_library_reference/RequestPrinterStatus.php
Before printing you should use RequestPrinterStatus with StatusCommand 101.
Then you should use PrintDocument.
Then you should use RequestPrinterStatus with StatusCommand 200 in a loop.
If there's no returning value 1 then the print job should be finished or your printer doesn't like this function ;-)

Cheers and welcome here,
Ingo

BTW: What could be the sense to know (and stop the program) if a printout is finished?  ;-)



-------------
Cheers,
Ingo



Posted By: Natalia
Date Posted: 10 Aug 15 at 9:55PM
Thanks Ingo,
StatusCommand 200 seems to work if the print job succeeds.
Do you know what would happen if the job fails after PrintDocument() function exits?

Regarding the reason, our server does additional processing on print job at the end of the printing, we need to wait till printing is complete. Ideally, we would listen to some signal from the library, but as far as I understood no signals are available. I'll add polling loop for now, but I'm not sure how it would affect the performance. It should be more efficient using some signal or callback.
I think the common scenario is notifying user when printing is complete.

Thanks again,
Natalia.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk