PSPDFKit 2.13 Migration Guide

This guide covers migrating to PSPDFKit 2.13 for React Native, since the processAnnotations API was updated. This change enables you to specify an Array of annotation types that should be flattened or embedded in the new document, and it’s now possible specify a password to unlock the source document, if required:

In previous versions, the processAnnotations API was used as follows:

const result = await PSPDFKit.processAnnotations(
	'flatten',
	'all',
	sourceDocumentPath,
	processedDocumentPath,
);

As of PSPDFKit 2.13 for React Native, you can now specify multiple annotation types to include in the processing operation. The last parameter of the method can be used to specify the password to unlock the source document specified in the third parameter:

const result = await PSPDFKit.processAnnotations(
	Annotation.Change.FLATTEN,
	[Annotation.Type.INK, Annotation.Type.STAMP],
	sourceDocumentPath,
	processedDocumentPath,
	null, // `null` if no password is required.
);

For more information, refer to the PSPDFKit 2.13 for React Native changelog.