com.pspdfkit.api.PdfDocument |
Represents an instance of a PDF document.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract DocumentEditor |
createDocumentEditor()
Creates a
DocumentEditor with the current PdfDocument as the base to work from. | ||||||||||
abstract void |
destroy()
Destroys this instance of the PdfDocument.
| ||||||||||
abstract void |
exportDocumentJson(WritableDataProvider writableDataProvider)
Exports Instant Document Json to a OutputStream
For more information on the format, visit https://pspdfkit.com/guides/web/current/importing-exporting/instant-json/
| ||||||||||
abstract void |
exportXfdf(WritableDataProvider writableDataProvider, Set<Integer> annotationsToExport, Set<String> formFieldsToExport)
Exports XFDF to a OutputStream
For the XFDF specification please see https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en
| ||||||||||
abstract AnnotationProvider |
getAnnotationProvider()
Returns
AnnotationProvider object which handles annotations contained in this document. | ||||||||||
abstract FormProvider |
getFormProvider()
Returns
FormProvider object which handles forms contained in this document. | ||||||||||
abstract PdfPage |
getPage(int pageIndex)
The
PdfPage for the given index. | ||||||||||
abstract long |
getPageCount()
The number of pages in the document.
| ||||||||||
abstract PdfProjection |
getPdfProjection()
Returns auxiliary projection class for mapping coordinate space between raw and normalized Pdf.
| ||||||||||
abstract void |
importDocumentJson(DataProvider dataProvider)
Import Instant Document Json from an
DataProvider . | ||||||||||
abstract void |
importXfdf(DataProvider dataProvider)
Import XFDF from an
DataProvider . | ||||||||||
abstract static PdfDocument |
open(DataProvider dataProvider)
Creates a
PdfDocument instance from a DataProvider . | ||||||||||
abstract void |
save(DocumentSaveOptions documentSaveOptions)
Save the current state back to the
DataProvider used to open the document. | ||||||||||
abstract void |
saveAs(WritableDataProvider dataProvider, DocumentSaveOptions documentSaveOptions)
Performs a full save of the document to a destination
WritableDataProvider . |
Creates a DocumentEditor
with the current PdfDocument
as the base to work from.
Destroys this instance of the PdfDocument. Useful to close any remaining open files after being done with the document.
Exports Instant Document Json to a OutputStream For more information on the format, visit https://pspdfkit.com/guides/web/current/importing-exporting/instant-json/
writableDataProvider | A `WritableDataProvider` to write the Document Json to. |
---|
Exports XFDF to a OutputStream For the XFDF specification please see https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en
writableDataProvider | A `WritableDataProvider` to write the XFDF to. |
---|---|
annotationsToExport | A Nullable set of annotation id's to export. |
formFieldsToExport | A Nullable set of form field names to export. |
Returns AnnotationProvider
object which handles annotations contained in this document.
Returns FormProvider
object which handles forms contained in this document.
The number of pages in the document.
Returns auxiliary projection class for mapping coordinate space between raw and normalized Pdf.
Import Instant Document Json from an DataProvider
. For more information on the format, visit
https://pspdfkit.com/guides/web/current/importing-exporting/instant-json/
dataProvider | An DataProvider holding the Document Json.
|
---|
Import XFDF from an DataProvider
. For the XFDF specification please see
https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en
dataProvider | An DataProvider holding the XFDF.
|
---|
Creates a PdfDocument
instance from a DataProvider
.
dataProvider | The data holding a valid document. |
---|
PdfDocument
representing the data given.
Save the current state back to the DataProvider
used to open the document.
documentSaveOptions | Options to customize the save. See DocumentSaveOptions . |
---|
IOException | Throws if it is not possible to write to the open DataProvider .
|
---|
Performs a full save of the document to a destination WritableDataProvider
. getIncremental()
and getForceSave()
will be ignored as a full
write is required to save to a new destination.
dataProvider | The destination to write the document to. |
---|---|
documentSaveOptions | Options to customize the save. See DocumentSaveOptions .
|