java.lang.Object | |
↳ | com.pspdfkit.document.formatters.XfdfFormatter |
Provides methods for exporting data in XFDF format from the document as well as parsing the existing XFDF data and applying it to the document.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
XfdfFormatter() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static List<Annotation> |
parseXfdf(PdfDocument document, DataProvider dataProvider)
Parses XFDF file served by the data provider and returns a list of annotations that can be
added to the document.
| ||||||||||
static Single<List<Annotation>> |
parseXfdfAsync(PdfDocument document, DataProvider dataProvider)
Parses XFDF file served by the data provider and returns a list of annotations that can be
added to the document.
| ||||||||||
static void |
writeXfdf(PdfDocument document, List<Annotation> annotations, List<FormField> formFields, OutputStream outputStream)
Generates an XFDF file out of provided annotations and form fields and writes the output to
the given output stream.
| ||||||||||
static Completable |
writeXfdfAsync(PdfDocument document, List<Annotation> annotations, List<FormField> formFields, OutputStream outputStream)
Generates an XFDF file out of provided annotations and form fields and writes the output to
the given output stream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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 addAnnotationToPage(Annotation)
.
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.
document | Document for which we're parsing XFDF file. |
---|---|
dataProvider | Data provider serving the source XFDF file. |
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 addAnnotationToPage(Annotation)
.
The returned completable will emit a XfdfFormatterException
when encountering an
unexpected error while importing the XFDF.
document | Document for which we're parsing XFDF file. |
---|---|
dataProvider | Data provider serving the source XFDF file. |
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.
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. |
IllegalArgumentException | If one of the passed annotations isn't attached to the document. |
---|---|
IOException |
Generates an XFDF file out of provided annotations and form fields and writes the output to the given output stream.
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, or null . |
outputStream | Output stream for writing the generated XFDF file. |
IllegalArgumentException | If one of the passed annotations isn't attached to the document. |
---|