The following code snippet shows how to rotate output pages when rendering a document as PDF:
importcom.groupdocs.viewer.Viewer;importcom.groupdocs.viewer.options.PdfViewOptions;importcom.groupdocs.viewer.options.Rotation;// ...
try(Viewerviewer=newViewer("sample.docx")){PdfViewOptionsviewOptions=newPdfViewOptions();// Rotate the first page.
viewOptions.rotatePage(1,Rotation.ON_90_DEGREE);viewer.view(viewOptions);}