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.

Thu Jun 02, 2022 1:07 pm

Hello, we're encountering an issue with spire.pdf while printing. The behavior is that we are sending 1 pdf document with around 50 to 300 pages and when it reach the printer it prints only 2 pages, then wait, then print 2 pages again, then wait. And it's like that for the whole document which is taking way too long. We also tried printing these documents through MS Edge on the same server with the same printer and it prints very fast with no wait time.

OS:
Windows 2019 - 17763

Software:
Console app on .NET 5.0
Licensed spire.pdf version tested 7.2 and 7.12.1

Code:
Code: Select all
Spire.Pdf.PdfDocument document = new Spire.Pdf.PdfDocument("C:\\Deployment\\Print\\test.pdf");
document.PrintSettings.PrinterName = printerName;
document.PrintSettings.PrintController = new StandardPrintController();
document.PrintSettings.Copies = 1;
document.PrintSettings.Duplex = Duplex.Simplex;
document.Print();


I would appreciate any help!
Thanks,
Patrick

ptremblay
 
Posts: 2
Joined: Thu Jun 02, 2022 12:51 pm

Fri Jun 03, 2022 2:54 am

Hello,

Thanks for your message.
Our current latest version is Spire.PDF Pack(Hot Fix) Version:8.5.0, you can use this version to try again. If your issue still exists, please help to share the following more information with us. Thanks in advance.
1. Your PDF file, you could upload it to the DropBox or OneDrive and then share the download link with us.
2. Your printer name. How about the printing time if you print with Microsoft XPS Document Writer?

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1533
Joined: Wed Apr 25, 2018 3:20 am

Fri Jun 03, 2022 12:31 pm

Yesterday we tried the latest version 8.5 with no difference. As for PDF file, we also tried many different PDF, one was a computer monitor manual and the behavior was exactly the same. The printer we use is a RICOH MP 9003 driver version 10.0.17763.1.

ptremblay
 
Posts: 2
Joined: Thu Jun 02, 2022 12:51 pm

Mon Jun 06, 2022 9:08 am

Hello,

Thanks for your feedback.
Sorry we do not have a printer of the same model as yours, I simulated a PDF file (77pages/7MB) and printed to Microsoft XPS Document Writer, it cost about 184s but the pages are printed one after the other, there isn't any wait. Besides, I used the attached XpsPrintHelper to test the following code, the printing speed could be improved. Thus, as for your situation, I first suggest that you use the XpsPrintHelper to try again.
Code: Select all
 Spire.Pdf.PdfDocument document = new Spire.Pdf.PdfDocument(@"input.pdf");
 document.PrintSettings.Copies = 1;
 document.PrintSettings.Duplex = Duplex.Simplex;
 MemoryStream ms = new MemoryStream();
 document.SaveToStream(ms, FileFormat.XPS);
  ms.Position=0;
 XpsPrint.XpsPrintHelper.Print(ms, "Microsoft XPS Document Writer", "PrintTest", true);

And kindly noye that the process of our product is purely programmatic, so the printing performance cannot be compared with the printing programs of applications such as Adobe. The printing principle of our product is to draw the object first and then call the .NET print API (System.Drawing.Printing) to print. You also can try to print directly using the .NET print API and see how long it takes.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1533
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.PDF