The following code snippet shows how to rotate output pages when rendering a document as PDF:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...using(Viewerviewer=newViewer("sample.docx")){// Create a PDF file.PdfViewOptionsviewOptions=newPdfViewOptions();// Rotate the first page.viewOptions.RotatePage(1,Rotation.On90Degree);viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())UsingviewerAsViewer=NewViewer("sample.docx")' Create a PDF file.
DimviewOptionsAsPdfViewOptions=NewPdfViewOptions()' Rotate the first page.
viewOptions.RotatePage(1,Rotation.On90Degree)viewer.View(viewOptions)EndUsingEndSubEndModule
sample.docx is the sample file used in this example. Click here to download it.