com.groupdocs.viewer.converter.options

Class HtmlOptions



  • public class HtmlOptions
    extends RenderOptions

    Provides options for rendering documents as HTML.

    • Constructor Detail

      • HtmlOptions

        public HtmlOptions()

        Initializes a new instance of HtmlOptions object.

    • Method Detail

      • getEmbedResources

        public boolean getEmbedResources()
      • getEnableMinification

        public boolean getEnableMinification()
      • getEnableResponsiveRendering

        public boolean getEnableResponsiveRendering()
      • getExcludeFonts

        public boolean getExcludeFonts()
      • getExcludeFontsList

        public List<String> getExcludeFontsList()
      • getHtmlResourcePrefix

        public String getHtmlResourcePrefix()

        Specifies prefix for HTML resources.


         The following example demonstrates how to specify resource prefix.
         
        HtmlOptions htmlOptions = new HtmlOptions();
         htmlOptions.setEmbedResources(false);
         htmlOptions.setHtmlResourcePrefix("http://example.com/api/getResource?name=");
         


         The following example demonstrates how to specify resource prefix with replacement patterns.
         
        HtmlOptions htmlOptions = new HtmlOptions();
         htmlOptions.setEmbedResources(false);
         htmlOptions.setHtmlResourcePrefix("http://example.com/api/pages/{page-number}/resources/{resource-name}");
         

        Value: The HTML resource prefix.


        Resource prefix may be useful when resources for document are obtained via some REST API method. Supported replacement patterns: {page-number}, {resource-name}.

      • getIgnorePrefixInResources

        public boolean getIgnorePrefixInResources()
      • setEmbedResources

        public void setEmbedResources(boolean value)
      • setEnableMinification

        public void setEnableMinification(boolean value)
      • setEnableResponsiveRendering

        public void setEnableResponsiveRendering(boolean value)
      • setExcludeFonts

        public void setExcludeFonts(boolean value)
      • setExcludeFontsList

        public void setExcludeFontsList(List<String> value)
      • setHtmlResourcePrefix

        public void setHtmlResourcePrefix(String value)

        Indicates whether rendering will provide responsive web pages, that look well on different device types. Default value is false.


         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);
         

      • setIgnorePrefixInResources

        public void setIgnorePrefixInResources(boolean value)