public class HtmlOptions extends RenderOptions
Provides options for rendering documents as HTML.
RENDER_COMMENTS_DEFAULT, SHOW_HIDDEN_PAGES_DEFAULT
Constructor and Description |
---|
HtmlOptions()
Initializes a new instance of
HtmlOptions object. |
Modifier and Type | Method and Description |
---|---|
boolean |
getEmbedResources() |
boolean |
getEnableMinification() |
boolean |
getEnableResponsiveRendering() |
boolean |
getExcludeFonts() |
List<String> |
getExcludeFontsList() |
String |
getHtmlResourcePrefix() |
boolean |
getIgnorePrefixInResources() |
void |
setEmbedResources(boolean value)
Indicates whether to embed resources into HTML or not.
|
void |
setEnableMinification(boolean value)
Indicates whether output content (HTML, SVG and CSS) should be minified.
|
void |
setEnableResponsiveRendering(boolean value)
Indicates whether rendering will provide responsive web pages, that look well on different device types.
|
void |
setExcludeFonts(boolean value)
Indicates whether to include fonts into HTML.
|
void |
setExcludeFontsList(List<String> value)
The list of font names, that will be excluded from HTML.
|
void |
setHtmlResourcePrefix(String value)
Specifies prefix for HTML resources.
|
void |
setIgnorePrefixInResources(boolean value)
Indicates whether to ignore resource prefix for nested resources.
|
getArchiveOptions, getCadOptions, getCellsOptions, getCountPagesToRender, getDefaultFontName, getEmailOptions, getJpegQuality, getOutlookOptions, getPageNumber, getPageNumbersToRender, getPassword, getPdfOptions, getProjectOptions, getRenderComments, getShowHiddenPages, getSlidesOptions, getTransformations, getWatermark, getWordsOptions, setArchiveOptions, setCadOptions, setCellsOptions, setCountPagesToRender, setDefaultFontName, setEmailOptions, setJpegQuality, setOutlookOptions, setPageNumber, setPageNumbersToRender, setPassword, setPdfOptions, setProjectOptions, setRenderComments, setShowHiddenPages, setSlidesOptions, setTransformations, setWatermark, setWordsOptions
public HtmlOptions()
Initializes a new instance of HtmlOptions
object.
public boolean getEmbedResources()
setEmbedResources(boolean)
public boolean getEnableMinification()
setEnableMinification(boolean)
public boolean getEnableResponsiveRendering()
public boolean getExcludeFonts()
setExcludeFonts(boolean)
public List<String> getExcludeFontsList()
setExcludeFontsList(List)
public String getHtmlResourcePrefix()
setHtmlResourcePrefix(String)
public boolean getIgnorePrefixInResources()
setIgnorePrefixInResources(boolean)
public void setEmbedResources(boolean value)
Indicates whether to embed resources into HTML or not.
Note:Example:
The following example demonstrates how to separate resources from HTML.
ViewerConfig config = new ViewerConfig();
config.setEnableCaching(true);
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "C:\storage\document.doc";
HtmlOptions options = new HtmlOptions();
options.setEmbedResources(false);
List<PageHtml> pages = htmlHandler.getPages(guid, options);
value
- public void setEnableMinification(boolean value)
Indicates whether output content (HTML, SVG and CSS) should be minified. Default value is false.
Example:
The following example demonstrates how to enable minification.
ViewerConfig config = new ViewerConfig();
config.setEnableCaching(true);
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "C:\storage\document.doc";
HtmlOptions options = new HtmlOptions();
options.setEnableMinification(true);
List<PageHtml> pages = htmlHandler.getPages(guid, options);
value
- Whether output content (HTML, SVG and CSS) should be minified.public void setEnableResponsiveRendering(boolean value)
Indicates whether rendering will provide responsive web pages, that look well on different device types. Default value is false.
Example:
The following example demonstrates how to enable responsive rendering.
ViewerConfig config = new ViewerConfig();
config.setEnableCaching(true);
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "C:\storage\document.doc";
HtmlOptions options = new HtmlOptions();
options.setEnableResponsiveRendering(true);
List<PageHtml> pages = htmlHandler.getPages(guid, options);
value
- Whether rendering will provide responsive web pagespublic void setExcludeFonts(boolean value)
Indicates whether to include fonts into HTML. Default value is false.
Note:Example:
The following example demonstrates how to prevent adding fonts into HTML.
ViewerConfig config = new ViewerConfig();
config.setEnableCaching(true);
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "C:\storage\document.doc";
HtmlOptions options = new HtmlOptions();
options.setExcludeFonts(true);
List<PageHtml> pages = htmlHandler.getPages(guid, options);
value
- Whether to include fonts into HTML.public void setExcludeFontsList(List<String> value)
The list of font names, that will be excluded from HTML.
Note:Example:
The following example demonstrates how to exclude specific fonts.
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler();
String guid = "C:\storage\document.pptx";
HtmlOptions options = new HtmlOptions();
options.getExcludeFontsList().add("Times New Roman");
options.setExcludeFontsList().add("Courier New");
List<PageHtml> pages = htmlHandler.GetPages(guid, options);
value
- The list of font namespublic void setHtmlResourcePrefix(String value)
Specifies prefix for HTML resources.
Note:Example:
The following example demonstrates how to specify resource prefix.
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.setResourcesEmbedded(false);
htmlOptions.setHtmlResourcePrefix("http://example.com/api/getResource?name=")
Example:
The following example demonstrates how to specify resource prefix with replacement patterns.
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.setResourcesEmbedded(false);
htmlOptions.setHtmlResourcePrefix("http://example.com/api/pages/{page-number}/resources/{resource-name}");
value
- The HTML resource prefix.public void setIgnorePrefixInResources(boolean value)
Indicates whether to ignore resource prefix for nested resources. Nested resource is a resource that resides inside another resource.
Note:Example:
The following example demonstrates how to ignore prefix when processing resources. In this example
specified prefix will be added only inside HTML content, and will not be applied to the links inside
CSS or SVG documents that will be generated.
ViewerConfig config = new ViewerConfig();
config.setEnableCaching(true);
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "C:\storage\document.doc";
HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.setResourcesEmbedded(false);
htmlOptions.setHtmlResourcePrefix("http://example.com/api/pages/{page-number}/resources/{resource-name}");
htmlOptions.setIgnorePrefixInResources(true);
List<PageHtml> pages = htmlHandler.getPages(guid, options);
value
- Whether to ignore resource prefix for nested resources.