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 - printDocument fails
  FAQ FAQ  Forum Search   Register Register  Login Login

printDocument fails

 Post Reply Post Reply
Author
Message
MrPopup View Drop Down
Team Player
Team Player
Avatar

Joined: 19 Dec 05
Location: New Zealand
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrPopup Quote  Post ReplyReply Direct Link To This Post Topic: printDocument fails
    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
Back to Top
dsola View Drop Down
Team Player
Team Player


Joined: 28 Oct 05
Location: Croatia
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dsola Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 09 at 7:19AM
We have same problem with delphi version.

Still have no solution  Cry



Edited by dsola - 14 May 09 at 7:22AM
registered QuickPDF user
Back to Top
dsola View Drop Down
Team Player
Team Player


Joined: 28 Oct 05
Location: Croatia
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dsola Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 09 at 8:09AM
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
Back to Top
MrPopup View Drop Down
Team Player
Team Player
Avatar

Joined: 19 Dec 05
Location: New Zealand
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote MrPopup Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 09 at 3:08PM
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
Smile
Back to Top
dsola View Drop Down
Team Player
Team Player


Joined: 28 Oct 05
Location: Croatia
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dsola Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 09 at 2:35AM
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
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