// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java
try {
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.getConfiguration();
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = fileName;
// Set rotation angle 90 for page number 3
RotatePageOptions rotateOptions = new RotatePageOptions(3, rotationAngle);
// Perform page rotation
htmlHandler.rotatePage(guid, rotateOptions);
// Set html options to include rotate transformation
HtmlOptions options = new HtmlOptions();
options.setTransformations(Transformation.Rotate);
// Get All pages
List<PageHtml> pages = htmlHandler.getPages(guid, options);
// Save pages
for (PageHtml page : pages) {
Utilities.saveAsHtml(page.getPageNumber() + "_" + fileName, page.getHtmlContent());
}
} catch (Exception exp) {
System.out.println("Exception: " + exp.getMessage());
exp.printStackTrace();
}