usmanazizgroupdocs
4/15/2016 - 10:33 AM

RetrieveAllHtmlPagesExludingTransformation.java

// 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.gaetConfiguration();
	// Create html handler
	ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
	String guid = fileName;

	// Set html options NOT to include rotate transformation
	HtmlOptions noTransformationsOptions = new HtmlOptions();
	noTransformationsOptions.setTransformations(Transformation.None);

	// Get html representation of all document pages, without
	// transformations
	List<PageHtml> pagesWithoutTransformations = htmlHandler.getPages(guid, noTransformationsOptions);

	// Get html representation of all document pages, without
	// transformations
	List<PageHtml> pagesWithoutTransformations2 = htmlHandler.getPages(guid);
	for (PageHtml page : pagesWithoutTransformations) {
		Utilities.saveAsHtml(page.getPageNumber() + "_" + fileName, page.getHtmlContent());
	}
} catch (Exception exp) {
	System.out.println("Exception: " + exp.getMessage());
	exp.printStackTrace();
}