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);
}