java RetrieveAllHtmlPagesExludingTransformation.java

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 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();
}

以上是关于java RetrieveAllHtmlPagesExludingTransformation.java的主要内容,如果未能解决你的问题,请参考以下文章

Java 布尔运算

java [Java] Java常用代码#java

Java - 35 Java 实例

Java While 循环

Java 字符串

Java If ... Else