Print Page | Close Window

problems printing a list of pdf

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=2189
Printed Date: 26 Jun 25 at 6:29PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: problems printing a list of pdf
Posted By: lbcs
Subject: problems printing a list of pdf
Date Posted: 14 Mar 12 at 7:45AM
Hi, my procedure creates pdf documents and stores them in an archive; the size of the documents is always between 1 and 3 pages (80-200 Kb).
Later a user selects a list of documents and prints them, but 'sometimes' documents with more than 1 page have a problem; the first page is ok, the second is not printed and instead you get a blank page. The doc is ok, if you select it again and print it alone, it works.
For example, yesterday they printed a list of 50 docs, and the 32nd (2-page doc) was printed like that, first page ok and a blank page.
I think it could be a network problem or a printer problem, maybe the print queue is too long. Should I slow the process adding some delay ?
 
thanks



Replies:
Posted By: jpbro
Date Posted: 14 Mar 12 at 12:58PM
Are you removing the documents from QPDF after you print them? If not, they will all be in memory (32 documents and counting), and perhaps you are running out of memory?

Maybe you could share your print code so we can see if we can spot a problem?


Posted By: AndrewC
Date Posted: 14 Mar 12 at 1:49PM
Are you using multitheading to print the documents ?



Posted By: Ingo
Date Posted: 14 Mar 12 at 8:55PM
Hi!

I think Andrews questions goes the right way.
Calling the function again before there's the result from the call before
could let you stumble into problems ;-)

Cheers, Ingo


Posted By: lbcs
Date Posted: 15 Mar 12 at 7:03AM
I use the DLL with MS Visual C++ 6.0 and i don't use multithreading.
I just use my PrintQuick class with some functions.
 
PrintQuick::PrintQuick()
{
   pdf = new QuickPDFDLL0812(...path...);
   pdf->UnlockKey(...);
   pdf->SetPageSize(L"A4");
}
PrintQuick::LoadFile(wPathFile)
{
    int iRet = pdf->LoadFromFile(wPathFile,L"");
}
PrintQuick::RemoveFile()
{
    int iId = pdf->SelectedDocument();
    pdf->RemoveDocument(iId);
}
PrintQuick::PrintFile(printer)
{
     std::wstring wQuickPrn = pdf->NewCustomPrinter(printer);
     pdf->SetupCustomPrinter(wQuickPrn,1,DMPAPER_A4);
     int iNum = pdf->PageCount();
     int iOptions = pdf->PrintOptions(1,0,L"Print Options"); // fit to page
     pdf->PrintDocument(wQuickPrn,1,iNum,iOptions);
}
PrintQuick::~PrintQuick()
{
   delete pdf;
}
 
When the user selects a list of docs to print, there's just a loop:
for (iDoc=0;iDoc<iMaxDoc;iDoc++)
{
 CPrintQuick printPdf;
 printPdf.LoadFile(ListDoc.GetAt(iDoc));
 printPdf.PrintFile(printerName);
 printPdf.RemoveFile();
}
 
thanks



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