Optimize HTML for printing

If you need to optimize HTML output for printing you should use setForPrinting() option of HtmlViewOptions. This option implemented for:

  • Presentation documents: PPT, PPS, PPTX, PPSX, ODP, FODP, OTP, POT, POTX, POTM, PPTM, PPSM
  • Diagram documents: VSD, VSDX, VSS, VST, VSX, VTX, VDW, VDX, VSSX, VSTX, VSDM, VSSM, VSTM
  • Meta file formats: WMF, WMZ, EMF, EMZ
    try (Viewer viewer = new Viewer("some-document.doc")) {
        HtmlViewOptions options = HtmlViewOptions.forEmbeddedResources("result.html");
        //HtmlViewOptions options = HtmlViewOptions.forExternalResources("p_{0}.html", "p_{0}_{1}", "p_{0}_{1}");

        options.setForPrinting(true);

        viewer.view(options);
    }

If ForPrinting option is enabled output HTML pages will be converted to vector SVG format for better quality for print and page layout.