Rotate pages

Flip or rotate pages

To rotate a page when rendering document, use the RotatePage method of the ViewOptions class. This method has the following two parameters:

  1. page number
  2. rotation angle

The rotation angle is one of the following:

The following code snippet shows how to rotate output pages when rendering a document as PDF:

using (Viewer viewer = new Viewer("sample.docx"))
    // Create a PDF file.
    PdfViewOptions viewOptions = new PdfViewOptions();
    // Rotate the first page.
    viewOptions.RotatePage(1, Rotation.On90Degree);

You can also view the example in our public GitHub repository .