Posted by a ceTe Software moderator
Hello,
You can achieve your requirement by rotating the landscape pages in the PDF. You will need to loop through the print job pages in the PrintJob, check for the landscape pages by comparing the width and height of the PDF page and set the orientation type and rotation accordingly. Here is the code sample:
Printer printer = new Printer("PrinterName");
InputPdf pdf = new InputPdf(@"Input PDF file path");
PrintJob printJob = new PrintJob(printer,pdf);
for(int i=0;i<printJob.Pages.Count;i++)
{
PrintJobPage page = printJob.Pages[i];
if (page.InputPdfPage.Width > page.InputPdfPage.Height)
{
page.PrintOptions.Inherit = false;
page.PrintOptions.Orientation.Type = OrientationType.Landscape;
page.PrintOptions.Orientation.Rotated = true;
}
}
printJob.Print();
Thanks,
ceTe Software Support Team.