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!
![]() |
printDocument fails |
Post Reply ![]() |
Author | |
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() Posted: 24 Apr 09 at 6:30PM |
Good morning forum members,
Details:
Version: 5.22 & 7.12
Style: AxtiveX
Application: Jade (www.jadeworld.com) based - similar to VB
I have a print server application that detects pdf files that need to be printed. It validates the file and then uses the printDocument method to launch the actual printing to the specified printer.
The process works successfully if in a single ' locate pdfs run' only one pdf file is located or if the multiple files are very small (1/4 pages).
However if a number of files are located and some are large (20 to 600 pages) the seciond and subsequent printDocument commends fails with error -2147418113 (null object reference).
A seperate QuickPDF object instance is created for each printDocument.
To me it appears that while the printDocument call returns to the calling method the AcitveX/library is still in fact still busy sending the file to the print spooler. As a result the next printDocument causes a failure. This implies that the library is neither thread safe nor actually capabile of multi-user activity.
For large files, if I put in a 2 minute delay prior to issuing the next printDocument all is well however this is not a satisfactory solution. (if the network is busy 2 minutes may be insufficient etc)
Does anyone have any suggestions please.
Thank you.
Charles
|
|
![]() |
|
dsola ![]() Team Player ![]() Joined: 28 Oct 05 Location: Croatia Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() |
We have same problem with delphi version.
Still have no solution ![]() Edited by dsola - 14 May 09 at 7:22AM |
|
registered QuickPDF user
|
|
![]() |
|
dsola ![]() Team Player ![]() Joined: 28 Oct 05 Location: Croatia Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() |
We found delphi workaround.
You can't print while printer is in "spooling mode" so before we sent another PDF to print we check if printer is out of spooling mode. |
|
registered QuickPDF user
|
|
![]() |
|
MrPopup ![]() Team Player ![]() ![]() Joined: 19 Dec 05 Location: New Zealand Status: Offline Points: 32 |
![]() ![]() ![]() ![]() ![]() |
Good morning Dsola,
Thanks for the comment. I would love to see the code/mechanism used to check the printers. I do have well over 100 printers on the server! I take it you just check the target printer?
Thank you.
Mrpopup
![]() |
|
![]() |
|
dsola ![]() Team Player ![]() Joined: 28 Oct 05 Location: Croatia Status: Offline Points: 34 |
![]() ![]() ![]() ![]() ![]() |
Hi MrPopUp.
Yes I know printername on which I need to print so I check just target printer. Delphi code: procedure TBatchPrint.DoWork(........); var xx: integer; printerName: string; begin printerName := Printer.Printers[FPrinterIndex]; // check if printer is spooling 500 times (500*.5sec= cca 4min) to avoid inifinite loop for xx := 1 to 500 do begin if not Printer.Printing then Break; Sleep(500); end; PrintDocument(.....); end; |
|
registered QuickPDF user
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store