Sometimes you won’t want your users to be able to print the content you serve. This guide outlines the default printing behavior and then shows a few ways to disable printing.
The printing toolbar item is enabled by default when the
download permission is granted in the JSON Web Token (JWT) used for authentication. This permission is required so that the client can access the raw PDF document needed.
The printing toolbar item is always enabled by default.
Below is an example of how to disable printing:
instance.setViewState((state) => state.set("allowPrinting", false));
The button will be marked as
disabled in the main toolbar. Please refer to the Toolbar API to find out how to remove the print button when it’s disabled.
Disable High-Quality Printing
PSPDFKit.PrintMode.DOM is used as the print mode, the printed document will have a resolution of 300 DPI. You can reduce the resolution to 150 DPI by disabling high-quality printing.