PDF Prints always in landscape

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v10)  /  PDF Prints always in landscape

DynamicPDF CoreSuite for .NET (v10) Forum

 Sep 11 2018 10:39 PM
Hello

When I print a PDF it always prints in Landscape and the content is always centered to the page. I want the PDF to be printed as it is in portrait mode. The content position should be same as in the PDF.

Please let me know what is require to be done

 InputPdf inPdf = new InputPdf(strFileName);
 printJob = new PrintJob(strPrinterName, inPdf);
 printJob.PrintOptions.Copies = 1;
 printJob.PrintOptions.Scaling = PageScaling.ActualSize;
 printJob.PrintOptions.PrintAnnotations = false;
 printJob.Print();

With Regards
Partha
 Sep 12 2018 4:14 PM
Posted by a ceTe Software moderator
Hello,
 
You can set the orientation for the pages in the PrintJob using OrientationType property. If you would like to print the pages in portrait mode, then set the OrientationType as Portrait. Here is the code sample:
 
            string strFileName = @"Input PDF file path";
            string strPrinterName = "Printer name";
            InputPdf inPdf = new InputPdf(strFileName);
            PrintJob printJob = new PrintJob(strPrinterName, inPdf);
            printJob.PrintOptions.Orientation.Type = OrientationType.Portrait;
            printJob.PrintOptions.Copies = 1;
            printJob.PrintOptions.Scaling = PageScaling.ActualSize;
            printJob.PrintOptions.PrintAnnotations = false;
            printJob.Print();
 
Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 11:57 PM.