Saving Triggers for Annotations and Bookmarks

PSPDFKit will save "dirty" (changed/created/deleted) annotations on several occasions.

  • When the viewController is popped. (In viewWillDisappear: - unless PSPDFKit is presenting a controller on top of it)
  • When the document on the PSPDFViewController is changed.
  • When saveAfterToolbarHiding of the PSPDFAnnotationToolbar is enabled.
  • When the app is moved into the background (UIApplicationDidEnterBackgroundNotification, UIApplicationWillTerminateNotification).
  • When UIActivityViewController asks for a document data/url to share.
  • When a document will be digitally signed.

Each time, the delegate method on PSPDFDocumentDelegate (void)pdfDocument:(PSPDFDocument *)document didSaveAnnotations:(NSArray *)annotations is called.

Saving can also be controlled on a per-document level by setting annotationSaveMode.

Manual Saving

Saving can always be triggered from the main thread by calling saveWithOptions:error: on the document.