writeXfdf

fun writeXfdf(document: PdfDocument, annotations: List<Annotation>, formFields: List<FormField>, outputStream: OutputStream, ignorePageRotation: Boolean = false)

Generates an XFDF file out of provided annotations and form fields and writes the output to the given output stream.

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.

Parameters

document

Document containing given annotations and form fields.

annotations

List of annotations to be parsed. The annotations need to be attached to the document, otherwise an exception is thrown.

formFields

List of form fields to be parsed.

outputStream

Output stream for writing the generated XFDF file.

ignorePageRotation

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

See also

Throws

If one of the passed annotations isn't attached to the document.