Just tried your latest version 6.8.5 as we have performance issues with printing PDFs.
I have 50 1-3 page PDFs. If I write a loop to create a PdfDocument, load the PDF, and print it (using out of the box settings), it's taking over 2 minutes to print. If I use PrintDocument.Print() instead, it completes in under 70 seconds. Seems the first page is painfully slow to print, and it's very common for the PDFs to contain just a single page.
We need to have high-performance printing due to high volumes of PDFs that we have to load and print. With some timings added around the pdf.Print() method (below), I can see some 1 page documents take 4 seconds to print. Why so long?
Why is the old PrintDocument.Print() so much faster? I've read similar posts in the past about this, but it still seems broken and very slow.
I've also tried loading the same documents into Adobe Reader and print to PDFCreator - they all take 1 second or less, even the 3 page ones. Why is there such a performance difference?
Code for testing is this (using PDFCreator just for simple tests - speed is just as bad with actual printers).
- Code: Select all
foreach (var file in files)
{
using (var pdf = new PdfDocument())
{
pdf.LoadFromFile(file);
pdf.PrintSettings.PrinterName = "PDFCreator";
pdf.PrintSettings.Collate = true;
pdf.PrintSettings.Copies = 1;
pdf.PrintSettings.Duplex = Duplex.Default;
pdf.PrintSettings.PrintController = new StandardPrintController();
pdf.Print();
}
}
Regards.
Haydn