Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Wait for print to complete
  FAQ FAQ  Forum Search   Register Register  Login Login

Wait for print to complete

 Post Reply Post Reply
Author
Message
Natalia View Drop Down
Beginner
Beginner


Joined: 10 Aug 15
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Natalia Quote  Post ReplyReply Direct Link To This Post Topic: Wait for print to complete
    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.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (1) Thanks(1)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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:
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

Back to Top
Natalia View Drop Down
Beginner
Beginner


Joined: 10 Aug 15
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Natalia Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store