parseXfdf

fun parseXfdf(document: PdfDocument, dataProvider: DataProvider, ignorePageRotation: Boolean = false): List<Annotation>

Parses XFDF file served by the data provider and returns a list of annotations that can be added to the document. This doesn't automatically add all the annotations to the document. To do that use com.pspdfkit.annotations.AnnotationProvider.addAnnotationToPage.

The method will throw a XfdfFormatterException when encountering an unexpected error while importing the XFDF.

Warning: this method runs on the current thread. If the current thread is the UI thread, it's recommended that you offload it to some other one, because this operation can take some time and thus block the UI.

Return

List of annotations parsed from the XFDF file, ready to be added to the document.

Parameters

document

Document for which we're parsing XFDF file.

dataProvider

Data provider serving the source XFDF file.

ignorePageRotation

Whether to ignore page transform matrices (rotation and CropBox offset) when parsing.

See also