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 document is saved the delegate method on PSPDFDocumentDelegate -pdfDocumentDidSave: is called. If there were no new changes to save, the delegate won't be 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.