Print Page | Close Window

PrintDocument never returns

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=3017
Printed Date: 04 Apr 26 at 3:09PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PrintDocument never returns
Posted By: matsj
Subject: PrintDocument never returns
Date Posted: 26 Nov 14 at 7:18AM
Hi all!
 
This is my first post in this forum.
 
I have a .NET program running in the background which is printing PDF documents. I have a problem with the PrintDocument function: When printing some PDFs the PrintDocument function call never returns. So my program just keeps waiting for it to return indefinitely!
 
Does anyone have a hint?
 
Using Debenu PDF Library 9.16, ActiveX version.
 
Best regards,
Mats



Replies:
Posted By: Ingo
Date Posted: 26 Nov 14 at 12:10PM
Hi Mats,
 
if you're printing in a Loop i would wait 'till PrintDocument Returns with result 1 before sending the next printjob.
 
Cheers and welcome here,
Ingo
 


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



Posted By: matsj
Date Posted: 26 Nov 14 at 12:23PM
Hi Ingo,
 
I'm not printing in a loop. To be on the safe side I wait until PrintDocument returns a result before issuing the next document. My problem is that PrintDocument NEVER returns. My program just "stands still" and wait for PrintDocument to return.
 
It happens on irregulary basis and I haven't been able to see a pattern yet, except that it seems to happen more often when printing larger documents (over 200 pages).
 
Best regards,
Mats


Posted By: AndrewC
Date Posted: 29 Nov 14 at 6:35AM
Mats,

Are you freeing the documents from memory after printing ?

  QP.RemoveDocument(QP.SelectectDocument());

Andrew


Posted By: Ingo
Date Posted: 29 Nov 14 at 11:11AM
As an addition to Andrew's post:
Does it happen with a very first printout, too?

Cheers, Ingo



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



Posted By: matsj
Date Posted: 02 Dec 14 at 10:30AM
Hi,
 
Andrew> Yes, I am freeing the document memory after printing by calling RemoveDocument.
 
Ingo> Since I'm loading a new instance of the ActiveX for every document you could say that it is always the first printout. I do not retain anything loaded in memory inbetween printouts.

Anyway I have now switched to using the dll version of QuickPDF instead of the ActiveX. Let's see if it helps.

My prime suspect for the problem is a buggy printer driver. Don't know whether it is possible at all, but a useful improvement to the PrintDocument function would be to add a timeout parameter. If the printer driver has not completed its work in a certain amount of time, PrintDocument would stop and return an error.

Regards,
Mats



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