com.groupdocs.viewer.converter.options

Class HtmlOptions



  • public class HtmlOptions
    extends RenderOptions

    Provides options for rendering documents as HTML.

    • Constructor Detail

      • HtmlOptions

        public HtmlOptions()
    • Method Detail

      • isResourcesEmbedded

        public boolean isResourcesEmbedded()

        Indicates whether to embed resources into HTML or not.

      • setResourcesEmbedded

        public void setResourcesEmbedded(boolean value)

        Indicates whether to embed resources into HTML or not.


         The following example demonstrates how to separate resources
         from HTML when rendering document as HTML.
         
         ViewerConfig config = new ViewerConfig();
         config.setUseCache(true);
         ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
         String guid = "C:\\storage\\document.doc";
         HtmlOptions options = new HtmlOptions();
         options.setResourcesEmbedded(false);
         java.util.List pages = htmlHandler.GetPages(guid, options);
         

      • getHtmlResourcePrefix

        public String getHtmlResourcePrefix()

        The prefix for HTML resource name.

      • setHtmlResourcePrefix

        public void setHtmlResourcePrefix(String value)

        Specifies prefix for HTML resource name.


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


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

      • getIgnoreResourcePrefixForCss

        public boolean getIgnoreResourcePrefixForCss()

        Indicates whether to ignore resource prefix when processing CSS or not.

      • setIgnoreResourcePrefixForCss

        public void setIgnoreResourcePrefixForCss(boolean value)

        Indicates whether to ignore resource prefix when processing CSS or not.


         The following example demonstrates how to ignore resource prefix when processing CSS.
         
         HtmlOptions options = new HtmlOptions();
         options.setHtmlResourcePrefix("http://example.com/api/getResource?name=");
         options.setIgnoreResourcePrefixForCss(true);