Optimize output for printing

To optimize HTML output for printing, use the ForPrinting boolean property of the HtmlViewOptions class.

If the ForPrinting option is enabled, the output HTML pages are converted to the vector SVG format.

This option is supported for the following format families:

  • 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

The following code snippet shows how to render a .docx document to HTML optimized for printing:

 using (Viewer viewer = new Viewer("sample.docx"))
{
    // Create an HTML file.
    var viewOptions = HtmlViewOptions.ForEmbeddedResources();
    // Render a file optimized for printing.
    viewOptions.ForPrinting = true;
    viewer.View(viewOptions);
}