Auto save annotations in React Native
PSPDFKit will automatically save changed, created, or deleted annotations to a document on several occasions. In practice, this means that automatic saving will be performed when:
- The application goes into the background
- A configuration change occurs (for example, change of device orientation, change of locale, added keyboard)
- The
NutrientViewis fully covered by anotherView - The document on the
NutrientViewis changed - A document will be digitally signed
Each time the document is saved, the onDocumentSaved() event is called:
onDocumentSaved={(event) => { alert("Document was saved!");}}If there were no new changes to save, the event won’t be called.
Disable automatic saving
To disable automatic saving, set the disableAutomaticSaving property to true in the configuration object, like so:
<NutrientView document={DOCUMENT} configuration={{ disableAutomaticSaving: true, }} ref={this.pdfRef} fragmentTag="PDF1"/>