Page Scaling

Below are some examples of printing a PDF with different page scaling options. Page scaling can be done by specifying a scaling factor with respect to the dimensions of the PDF page or it can be scaled with respect to the printable area or edges of the page.

Percentage Page Scaling

This example demonstrates how to scale a PDF page by a certain scaling factor. For example, a scaling factor of 0.5 scales the page dimensions by 50%.

PrintJob printJob = new PrintJob(Printer.Default, pdfFilePath);
PercentagePageScaling percentagePageScaling = new PercentagePageScaling(0.5f);
printJob.PrintOptions.Scaling = percentagePageScaling;
printJob.Print();  
Dim MyPrintJob As PrintJob = New PrintJob(Printer.Default, pdfFilePath)
Dim MyPercentagePageScaling As PercentagePageScaling = New PercentagePageScaling(0.5F)
MyPrintJob.PrintOptions.Scaling = MyPercentagePageScaling
MyPrintJob.Print()  

Printable Area or Page Edge Scaling

This example demonstrates how to scale a print job with respect to the page printable area. Use ScaleTo.PageEdges to scale the print job with respect to page edges.

PrintJob printJob = new PrintJob(Printer.Default, pdfFilePath);
AutoPageScaling autoPageScaling = new AutoPageScaling(ScaleTo.PagePrintableArea, true, true);
printJob.PrintOptions.Scaling = autoPageScaling;
printJob.Print(); 
Dim MyPrintJob As PrintJob = New PrintJob(Printer.Default, pdfFilePath)
Dim MyAutoPageScaling As AutoPageScaling = New AutoPageScaling(ScaleTo.PagePrintableArea, True, True)
MyPrintJob.PrintOptions.Scaling = MyAutoPageScaling
MyPrintJob.Print()    

In this topic