Table of Contents
  • Getting Started
  • EO.Pdf
  • EO.Web
  • EO.WebBrowser
  • EO.Wpf
  • Common Topics
  • Reference
    • .NET API Reference
      • EO.Base
      • EO.Base.UI
      • EO.Extensions
      • EO.Pdf
        • EO.Pdf
        • Classes
          • ClientCertificate Class
          • HtmlDocument Class
          • HtmlElement Class
          • HtmlNode Class
          • HtmlTextNode Class
          • HtmlToPdf Class
          • HtmlToPdfException Class
          • HtmlToPdfOptions Class
          • HtmlToPdfResult Class
          • HtmlToPdfSession Class
          • PageInfo Class
          • PageInfoCollection Class
          • PageStyle Class
          • Paginator Class
          • PdfAction Class
          • PdfAttachment Class
          • PdfAttachmentCollection Class
          • PdfBookmark Class
          • PdfBookmarkCollection Class
          • PdfCheckBoxField Class
          • PdfComboBoxField Class
          • PdfDestination Class
          • PdfDocInfo Class
          • PdfDocument Class
          • PdfDocumentEventArgs Class
          • PdfDocumentSecurity Class
          • PdfField Class
          • PdfFieldCollection Class
          • PdfGenericField Class
          • PdfGoToAction Class
          • PdfJavaScriptAction Class
          • PdfLaunchAction Class
          • PdfLink Class
          • PdfListBoxField Class
          • PdfListField Class
          • PdfListItem Class
          • PdfListItemCollection Class
          • PdfObject Class
          • PdfOnOffField Class
          • PdfPage Class
          • PdfPageCollection Class
          • PdfPageEventArgs Class
          • PdfPageLocation Class
          • PdfPageRectangle Class
          • PdfPageSizes Class
          • PdfPortfolio Class
          • PdfPushButtonField Class
          • PdfRadioButtonField Class
          • PdfRadioButtonGroup Class
          • PdfRender Class
          • PdfSigner Class
          • PdfTextField Class
          • PdfUriAction Class
          • PdfViewerException Class
          • PdfViewerPreference Class
          • Runtime Class
          • YRange Class
        • Interfaces
        • Enumerations
        • Delegates
      • EO.Pdf.Acm
      • EO.Pdf.Contents
      • EO.Pdf.Drawing
      • EO.Pdf.Mvc
      • EO.Web
      • EO.WebBrowser
      • EO.WebBrowser.DOM
      • EO.WebEngine
      • EO.WinForm
      • EO.Wpf
      • EO.Wpf.Gauge
      • EO.Wpf.Gauge.Shapes
      • EO.Wpf.Primitives
      • EO.Wpf.Themes.Aero
      • EO.Wpf.Themes.Classic
      • EO.Wpf.Themes.Luna
      • EO.Wpf.Themes.Metro
      • EO.Wpf.Themes.Royale
    • JavaScript API Reference
PdfPage.Transform Method 

Transform the page contents by the specific PdfMatrix.

Syntax
 public void Transform(
   PdfMatrix matrix
);

Parameters

matrix
The transformation matrix.
Remarks

The transformation can scale, translate, rotate, or skew page contents. For example, the following code rotates the page contents by 30 degrees clockwise:

//Rotate page contents by 30 degrees clockwise
PdfMatrix matrix = new PdfMatrix();
matrix.Rotate(-30);
pdfPage.Transform(matrix);

Please note:

  1. PDF page Y coordinates is from bottom to top. Thus you must use a negative offset Y value to move the contents downwards. For example, the following matrix moves the page contents downwards for one inch:

    //Matrix to move contents downwards for one inch
    matrix.Translate(0, -72);

    The default unit is 1/72 inch.

  2. Negative degrees rotate contents clockwise, positive degrees rotate contents counter clockwise. For example, the following matrix rotates the page contents 30 degrees clockwise:

    //Matrix to rotate the page contents 30 degrees clockwise
    matrix.Rotate(-30);

    The coordinate origin is the bottom left corner of the page.

The following code rotate the page 180 degrees:

PdfMatrix matrix = new PdfMatrix();
matrix.Rotate(180);
matrix.Translate(-612, -792);
pdfPage.Transform(matrix);

Note that you must also call Translate to translate the matrix sicne the coordinate origin is at the bottom left corner of the page. The exact translate amount depends on the size of the page. The above value is for page size 8.5 inch by 11 inch (612 = 8.5 * 72, 792 = 11 * 72).

See Also