This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/web/print/print-modes.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Print modes in JavaScript PDF viewer | Nutrient SDK

To print a document with Nutrient Web SDK, you can choose between two printing modes, each with its own tradeoffs.

The available modes are:

  • NutrientViewer.PrintMode.DOM
  • NutrientViewer.PrintMode.EXPORT_PDF

Set the default mode using printOptions.mode in the initial configuration:

NutrientViewer.load({
printOptions: {
mode: NutrientViewer.PrintMode.EXPORT_PDF,
},
}).catch((error) => {
console.error("Failed to load document:", error.message);
});

It’s also possible to enforce a print mode programmatically (try it in the Playground):

instance.print({
mode: NutrientViewer.PrintMode.EXPORT_PDF,
});

By default, Nutrient uses:

  • printOptions.mode = NutrientViewer.PrintMode.DOM
  • printOptions.quality = NutrientViewer.PrintQuality.LOW

NutrientViewer.PrintMode.DOM

NutrientViewer.PrintMode.DOM renders all pages into bitmaps and then prints them. It’s the default because it’s the most reliable cross-browser option, and it doesn’t give your users access to the source PDF file.

Tradeoffs

  • Bitmap-based output can appear blurry at lower quality settings.
  • CPU and memory usage scale with page count and page size.
  • Mixed page sizes can produce imperfect output due to CSS print limitations.

Use printOptions.quality to tune document object model (DOM) print quality.

NutrientViewer.PrintMode.EXPORT_PDF

NutrientViewer.PrintMode.EXPORT_PDF prints from a generated PDF instead of rasterizing each page. This is usually better for print fidelity and large documents.

Tradeoffs

  • Behavior depends on browser capabilities:
    • Some browsers print directly (hidden iframe plus browser print dialog).
    • Others fall back to opening the generated PDF in a new tab/window.
  • The fallback can make direct PDF access easier for end users.

Which one should you choose?

  • If your priority is best print fidelity and lower memory usage, use NutrientViewer.PrintMode.EXPORT_PDF.
  • If your priority is avoiding direct PDF exposure in the print flow and broad compatibility, keep NutrientViewer.PrintMode.DOM and increase printOptions.quality as needed.

Check out our API reference for more information.