Print PDFs without opening using JavaScript
You can trigger printing a PDF without displaying anything to the user. This can be achieved by running the SDK in headless mode by setting the headless option in the configuration options:
NutrientViewer.load({ headless: true // ...}) .then((instance) => { instance.print(); }) .catch((error) => { console.error("Failed to load document:", error.message); });This will load the PDF without displaying anything, and the PDF will print as usual when the print method is called.