How to use PDFRasterizer.Net for landscape printing


How to use PDFRasterizer.NET to print landscape pages.

Starting with version, the ScaledPrinting sample shows a landscape check box in its main window that implements landscape printing. Basically, it sets the DefaultPageSettings.LandScape flag of the used printer settings. In this way, the printPage event handler will automatically be provided with a Graphics instance that has a rotated coordinate system, and an adjusted VisibleClipBounds property. From that point on, printing is just a matter of drawing to this rotated space.

The sample contains some additional code for dealing with landscape printing. This is only needed to present the user with a rotated page in the preview. The most important step here is to flip the Width and Height of the selected paper size.

Further details can be found in the ScaledPrinting sample itself. See the Code Samples folder in the evaluation download.