Flip or rotate pages

The GroupDocs.Viewer enables you to rotate individual pages when viewing documents in HTML/PDF/JPG/PNG formats. To flip/rotate pages use the rotatePage() method of ViewOptions class.  The method accepts page number as the first parameter and rotation angle as the second parameter. There are three options that you can pass as the second parameter into rotatePage() method:

The following code snippet shows how to rotate output pages when viewing a document as PDF (this example can be also found in our public GitHub repository.)

    try (Viewer viewer = new Viewer("sample.docx")) {
        PdfViewOptions viewOptions = new PdfViewOptions();
        viewOptions.rotatePage(1, Rotation.ON_90_DEGREE);