I am using Aspose.Pdf. when I printing the Pdf File using Aspose.Pdf.Facades.PdfViewer, the page size (height and width) is condensed in C# windows application.
What I should do to print the exact size of document. I am using the below code.
pdfDocument.Save(@fileName.ToString());
Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();
viewer.BindPdf(@fileName.ToString());
viewer.AutoResize = true;
viewer.AutoRotate = true;
viewer.PrintPageDialog = false; // Do not produce the page number dialog when printing
System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
ps.PrinterName= cmbPrinter.Text;
//ps.PrintToFile = true;
ps.Copies= short.Parse(txtCount.Text.Trim());
System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();
// Set printer name
ps.PrinterName = prtdoc.PrinterSettings.PrinterName;
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
pgs.Landscape = true;
// 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);
// Print document using printer and page settings
viewer.PrintDocumentWithSettings(pgs, ps);
// Close the PDF file after priting
viewer.Close();
File.Delete(@fileName.ToString());