Document Permissions

PSPDFKit for Web respects the document permissions set in a PDF document and makes it possible to restrict them further.

If you use the Server-backed version of PSPDFKit for Web, you can also restrict the permissions of a document in the JSON Web Token (JWT) used for authentication.

Be aware that restricted document permissions set in a PDF itself or in the JWT cannot be overwritten.

The permissions outlined below can be set in PSPDFKit for Web.

Text Selection

When this permission is not given, users are not allowed to select text in a document. This permission is granted by default, but it can be disabled by setting the Configuration.disableTextSelection configuration value to true.

Printing

This permission specifies whether or not printing a document is allowed. This permission is granted by default, but it can be disabled via the JavaScript API.

High-Quality Printing

This permission specifies whether or not a document will be printed in high quality. When high-quality printing is enabled, a document will print with a resolution of 300 DPI; otherwise, 150 DPI will be used.

Be aware that high-quality printing uses more resources than low-quality printing, and this might affect the performance while printing.

Setting this permission will only have an effect if the print mode is set to PSPDFKit.PrintMode.DOM. If you want to print a document in lower quality, you can set the Configuration.disableHighQualityPrinting configuration value to true. This permission defaults to printing in high quality.

Modification

This permission specifies whether or not modifying a document is allowed. Modification is allowed by default, but it can be disabled using the Instance#setViewState function:

1
instance.setViewState(v => v.set("readOnly", true));
1
2
3
instance.setViewState(function(v) {
  return v.set("readOnly", true);
});

Forms

When this permission is disabled, users are not allowed to fill out forms. This permission is granted by default, but it can be disabled by setting the Configuration.disableForms configuration value to true.