I am trying to print the pdf file by using Aspose.pdf.kit.dll' s for .Net PdfViewer class, but it is printing by rotating the pdf file by 180 degree. (for example it is printin 6 as 9 and this is the issue when i am printing the landscape pdf file. I think there is a bug in Auto Rotate property of PdfViewer class) Following is the code:
Aspose.Pdf.Kit.License license = new Aspose.Pdf.Kit.License();
license.SetLicense("Aspose.Pdf.Kit.lic");
//create PdfViewer object
PdfViewer viewer = new PdfViewer();
viewer.OpenPdfFile(DirectPrintContentPath + DirectPrintContentFileName);
viewer.AutoResize = true;
viewer.AutoRotate = true;
viewer.PrintPageDialog = false;
System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();
System.Drawing.Printing.PrintDocument pdoc = new System.Drawing.Printing.PrintDocument();
ps.PrinterName = pdgDirectPrint.PrinterSettings.PrinterName;
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);
if (pgs.Landscape == true)
{
pgs.Landscape = true;
ps.DefaultPageSettings.Landscape = true;
pdoc.DefaultPageSettings.Landscape = true;
}
else
{
pgs.Landscape = false;
ps.DefaultPageSettings.Landscape = false;
pdoc.DefaultPageSettings.Landscape = false;
}
pgs.PaperSize = new System.Drawing.Printing.PaperSize(Convert.ToString(prnDoc.DefaultPageSettings.PaperSize), Convert.ToInt32(prnDoc.DefaultPageSettings.PaperSize.Width), Convert.ToInt32(prnDoc.DefaultPageSettings.PaperSize.Height));
for (int i = 1; i <= Convert.ToInt32(pdgDirectPrint.PrinterSettings.Copies); i++)
{
viewer.PrintDocumentWithSettings(pgs, ps);
}
viewer.ClosePdfFile();