These are the standard annotations (as defined in the PDF Reference) that can be read and written by many apps like Adobe Acrobat or even Apple's Preview.app. Most of these annotation types can also be written back, with the exception of RichMedia/Video/File and Widget. (See also: What are Annotations? Blog Post)

Working with Annotations in Code

You can work with all supported annotations not only in our UI but in code as well. We have API for getting, setting, modifying, removing and a lot more operations regarding annotations.

You can also remove all annotations from a document by using allAnnotationsOfType: and removeAnnotations:options:. Note: You usually don't want to remove links and form elements, which are also annotations. These annotation types can be excluded, as seen in the code snippet below.

Saving Annotations with PSPDFKit

Annotations can only be written back into the PDF if the file is writeable. The default location (App Bundle) is readonly. Copy the PDF into your Documents folder (see the example "Test PDF annotation writing" in PSPDFCatalog).

Optionally and as a fallback, annotations can also be written as external files. This is the default behavior if the PDF is readonly. This can be customized by changing annotationSaveMode. Valid options are: PSPDFAnnotationSaveModeDisabled, PSPDFAnnotationSaveModeExternalFile, PSPDFAnnotationSaveModeEmbedded, and PSPDFAnnotationSaveModeEmbeddedWithExternalFileAsFallback (default).

Checking if a Document Contains Annotations

When calling allAnnotationsOfType:, PSPDFKit will return all annotations of the specified type(s). To check if a document contains annotations, you will likely want to use PSPDFAnnotationTypeAll & ~(PSPDFAnnotationTypeLink|PSPDFAnnotationTypeWidget), like so:

This returns all annotations excluding links and widgets (buttons and all form elements; remember that form elements are also annotations, even though people don't usually consider them as such). allAnnotationsOfType: returns a dictionary where the key is the page number and the value is an array containing all annotations on that page, so you need to check if any of those arrays have any annotations.

PSPDFCatalog contains many examples of working with annotations, be sure to check them out.

Uniquely Identifying Annotations

Annotations created by PSPDFKit automatically set name to an unique identifier (UUID).
Name is defined in the PDF spec as Optional; PDF1.4, "NM" key: The annotation name, a text string uniquely identifying it among all the annotations on its page.