Controlling PDF Document Editing
PDF documents can be modified in several ways — for instance, by adding annotations or filling forms. The PDF format has standard restrictions (see Secured Documents), but in addition to those built-in restrictions, PSPDFKit gives you control over how to restrict certain modifications of PDF documents.
The following section assumes you’re familiar with annotations. If not, first see Introduction to Annotations for more details.
Disable the Modification of All Annotation Types
You can disable all annotation modifications using
PdfConfiguration by setting
null. This will prevent users from adding new annotations and editing existing ones:
Enable Modifications Only for Specific Annotation Types
You can control which annotation types are editable and you can specify their types in
editableAnnotationTypes. For example, you can allow only the modification of ink annotations:
Disable Adding New Annotations But Allow Modification of Existing Ones
PdfActivity’s annotation editing button from the toolbar will prevent users from adding new annotations, but it will not stop them from editing or deleting existing ones:
Disable the Modification of a Specific Annotation
You can disable the modification of a specific annotation by using
setFlags with the
READONLY flag, like so:
For more information, see the Annotation Flags guide.
The following section assumes you are familiar with forms. If not, first see Introduction to Forms for more details.
Disable All Form Interactions
You can disable all form interactions and modifications using
PDF documents can be modified using the Document Editor feature, which allows new page creation, page duplication, and the reordering, rotation, or deletion of pages. See the Document Editing guide for more details.