Storing PDF Annotation Data on iOS
Depending on how you implement annotation synchronization, the storage of annotation data is managed differently.
When Using Instant Synchronization
When using PSPDFKit Instant, annotation and form data are automatically stored on PSPDFKit Server as Instant JSON, separate from the underlying PDF document. No additional work is required.
When Building Your Own Solution
We recommend storing annotation and form data separately from the underlying PDF document. By storing the data separately, you’ll only need to sync the annotation and form data to your backend, as opposed to transferring the entire PDF. Your backend can store this data as a flat file or in a database.
Separating the annotation and form data from the underlying PDF document has the following advantages:
Reduced bandwidth: The PDF document is downloaded once, while smaller chunks of annotation data are synchronized to/from your server, as opposed to the entire PDF. See our Stop Wasting Bandwidth with PDFs — Transfer Changes with Instant JSON blog to learn more.
Reduced storage: A single version of a PDF document can be stored on your servers, with annotations and form data stored separately.
Improved performance: Instead of updating and synchronizing the entire PDF document, it’s faster to create, edit, and synchronize smaller data files.
PSPDFKit supports importing and exporting XFDF (XML Forms Data Format) and Instant JSON. You can read more about these formats, along with their benefits and drawbacks, in our annotation data formats guide. See how to import and export XFDF or Instant JSON.