Free Support Forum - aspose.com

Slow printing speed of PDF document

The print speed of PDF file based on the The previous source as shown below was normal.
But the printing speed of PDF file on the new source is significanty slow.
The differnece between two sources are the addition of Aspose.Pdf.Facades in the new source.
Please advise why this happens and any solutions to improve?
Thanks
HB

Previous source:
// Create PdfViewer object
PdfViewer viewer = new PdfViewer();

                // Open input PDF file
                viewer.BindPdf(dataDir2 + @"\" + name + "(수정)" + ext);

                // Set attributes for printing
                viewer.AutoResize = true;         // Print the file with adjusted size
                viewer.AutoRotate = true;         // Print the file with adjusted rotation
                viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

                // Create objects for printer and page settings and PrintDocument
                System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
                System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
                System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();

                // Set printer name
                ps.PrinterName = prtdoc.PrinterSettings.PrinterName;

                // Set PageSize (if required)
                pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);

                // Set PageMargins (if required)
                pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);

                label1.Text = "";

                label1.Text = "[인쇄중" + "(" + i.ToString() + ")] " + name + "(수정)" + ext;
                label1.Refresh();

                // ExStart:PrintDialog
                if (i == 1)
                {
                    System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
                    if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        // Document printing code goes here
                        // Print document using printer and page settings
                        viewer.PrintDocumentWithSettings(pgs, ps);
                    }
                }
                else
                {
                    viewer.PrintDocumentWithSettings(pgs, ps);
                }

New source:
// Create PdfViewer object
Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();

                    // Open input PDF file
                    viewer.BindPdf(dataDir2 + @"\" + name + "(수정)" + ext);

                    // Set attributes for printing
                    viewer.AutoResize = true;         // Print the file with adjusted size
                    viewer.AutoRotate = true;         // Print the file with adjusted rotation
                    viewer.PrintPageDialog = false;   // Do not produce the page number dialog when printing

                    // Create objects for printer and page settings and PrintDocument
                    System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
                    System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
                    System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();

                    // Set printer name
                    ps.PrinterName = prtdoc.PrinterSettings.PrinterName;

                    // Set PageSize (if required)
                    pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);

                    // Set PageMargins (if required)
                    pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);

                    label1.Text = "";

                    label1.Text = "[인쇄중" + "(" + i.ToString() + ")] " + name + "(수정)" + ext;
                    label1.Refresh();

                    // ExStart:PrintDialog
                    if (i == 1)
                    {
                        System.Windows.Forms.PrintDialog printDialog = new System.Windows.Forms.PrintDialog();
                        if (printDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            // Document printing code goes here
                            // Print document using printer and page settings
                           viewer.PrintDocumentWithSettings(pgs, ps);
                        }
                        else
                        {
                            Status = "CANCEL";
                            break;
                        }
                    }
                    else
                    {
                        viewer.PrintDocumentWithSettings(pgs, ps);
                    }

@hbhur102

Thanks for contacting support.

Would you please share a sample input document, which you are using along with shared code snippet. We will test the scenario in our environment and address it accordingly.

Hello, has any progress been made on this issue. I have the same problem, viewer.PrintDocumentWithSettings takes around a minute to print a small pdf document. We are hoping to use this product to print several pdf documents a day and this performance issue is a hang up.

Thanks,
Paul

@Paul.D.McDonald

Thank you for contacting support.

Please note that the issue was not logged in our issue management system owing to missing resources for reproducing it. Would you please share a narrowed down sample application reproducing this issue, along with all necessary resources so that we may try to reproduce and investigate it in our environment to help you out.

Hello, attached is a simple c# console application that prints a single page pdf document. We have a requirement that the application be able to print to any network printer (we have over 200), so this application will reside on a server and supply the name of the printer in the format \<printer name>.

When running the sample app, it takes approximately 70 seconds for the single page pdf to print.

Thank you for your help.
PaulAsposeSlowPrintingExample.zip (65.4 KB)

@Paul.D.McDonald

Thank you for sharing requested data.

We have logged an investigation ticket with ID PDFNET-45272 in our issue management system. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.