Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Mar 11, 2016 10:36 am

In our application we are using SpirePDF 3.6.167 to print pdf files. Printing works fine when we run a single print job. But when we try to print multiple pdf files for multiple printers the CPU goes up to 100% in the printing process. In our application we are using two threads for a printing job. One thread downloads a file and gives the control to another thread to do the printing.

Printing Function
========================================
Spire.Pdf.PdfDocument pdfDocument = new Spire.Pdf.PdfDocument();
pdfDocument.LoadFromFile(fileName);
pdfDocument.PageScaling = Spire.Pdf.PdfPrintPageScaling.ActualSize;

pdfDocument.PrinterName = printerName;
var printDocument = pdfDocument.PrintDocument;

printDocument.DocumentName = documentName;
printDocument.PrintPage += printDocument_PrintPage;
printDocument.PrinterSettings.Copies = (short)printEvent.Copies;

printDocument.Print();
=========================================

Allocating new thread for printing
===========================================
IWorkItemResult<PrintEventResult> workItem = printSpooler.QueueWorkItem(
new Amib.Threading.Func<PrintEvent, PrintEventResult>(SendFileToPrinter), printEvent);

printSpooler.Start();
printSpooler.WaitForIdle();
============================================

Is this a common issue while printing multiple pdf files from SpirePDF? If not what might be the cause for such high CPU usage??

janitha000
 
Posts: 15
Joined: Fri Mar 11, 2016 10:07 am

Mon Mar 14, 2016 3:39 am

Hi,

Thanks for your posting.
To help us reproduce and investigate your issue, please tell us your operating system environment and share your pdf files. The better to provide us your whole project if you can. Thank you.
You can also send them to [email protected].

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Mon Mar 14, 2016 11:14 am

I have sent you a sample code with along the pdf files we used. here is an example usage of the CPU when printing 20 documents using the same printer. Same happens when using different printers as well.

Thanks

i22^cimgpsh_orig.png

janitha000
 
Posts: 15
Joined: Fri Mar 11, 2016 10:07 am

Tue Mar 15, 2016 7:06 am

Hi,

I have received your project from your e-mail. Thanks for your sharing.
I reproduced your issue and forwarded it to our dev team. We will tell you when there is any update on it.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Fri Mar 18, 2016 7:53 am

Hi,

Can I know the progress of this issue, is it a bug on SpirePDF or a problem only in our side.

Thank you

janitha000
 
Posts: 15
Joined: Fri Mar 11, 2016 10:07 am

Fri Mar 18, 2016 8:09 am

Hi,

Thanks for your inquiry.
It is a bug but it is difficult to resolve it in a short time, sorry.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Sat Mar 19, 2016 6:22 am

Can I get a rough estimation of how much time will it take to resolve this issue?

janitha000
 
Posts: 15
Joined: Fri Mar 11, 2016 10:07 am

Mon Mar 21, 2016 1:56 am

Hi,

Sorry that now we don't have a timeline for it.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3043
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF