Pdf Document
A PDF document. To create an instance use PdfDocumentLoader.openDocument or related static methods on the PdfDocumentLoader class.
Inheritors
Types
Page-rotation constants (degrees, clockwise) returned by getPageRotation / getRotationOffset.
Indicates that the returned value is a page rotation.
Properties
AnnotationProvider object which handles annotations contained in this document.
BookmarkProvider object which handles bookmarks contained in this document.
PdfDocumentCheckpointer object which handles the checkpoint for the document. May be null if checkpoint is not supported.
A default set of document save options which have the same permissions, password and PDF version set as this document.
A permanent document identifier (inferred from document provider if possible). According to the PDF spec, this is based on the contents of the file at the time it was originally created, but in practice we might as well assume it to be random data. The value depends on the first document provider and may change after change to the document providers array.
A string representation of a document identifier.
Information about digital signatures in this document. This call may block for a while and should not be called from the main thread.
The original DocumentSource of this PdfDocument. If the document is a compound one (i.e. it contains multiple files) this returns the first entry of the list returned by documentSources.
List of DocumentSources from which this document is loaded. A source can be either a file URI or a com.pspdfkit.document.providers.DataProvider. Only compound documents will have multiple sources. For a non-compound document the list will contain a single entry.
EmbeddedFilesProvider object which handles embedded files contained in this document.
FormProvider object which handles forms contained in this document.
Whether or not automatic link generation is enabled. This property dictates if the document's text should be parsed and any clickable links automatically generated with its corresponding com.pspdfkit.annotations.LinkAnnotation.
Indicates if the PDF document is encrypted (= password protected).
Whether or not watermark filtering is enabled. setWatermarkTextFilteringEnabled dictates whether watermark text is filtered from text retrieval methods.
Whether the document data sources are read/write (come from a supported source) and whether saving is enabled. A compound document is writable when all of its sources are, saving writes each of them back to the file or data provider it was loaded from.
JavaScriptProvider object which handles JavaScript execution for this document.
List of top-level (outline / table-of-contents) bookmarks. Bookmarks are organized in a tree-like structure and can have children. Note that this may take a while and should not be called on the main thread. If you want a quick check for whether document has outline, use hasOutline.
The current document's PageBinding. This sets how the document is displayed, either left to right (page indexed 0 will be to the left), or right to left (page indexed 0 will be on the right). It is stored in the document metadata and persisted when reopening the document.
Metadata (title, author, creation date, ...) stored in the PDF document dictionary.
Auxiliary projection class for mapping coordinate space between raw and normalized PDF.
Current PDF version of the document, a value from the PdfVersion enum.
Unique Document Identifier used for AiAssistant.
Set of currently applied permission flags on this document.
The secondary unit value from the document, or null if none is set.
Document metadata stored in the XMP metadata entries included in the PDF file.
Functions
This adds long term validation to an existing signature form element that has already been signed or refreshes that information if the signature is already LTV enabled.
Creates a TextBlock from the given page.
Information about digital signatures in this document. This will be executed on a background dispatcher.
Returns the hash of a particular byte range of the document. This method works only on the first source of a compound document, use getHashForDocumentRange with a source index if you want to digest other sources.
Returns the hash of a particular byte range of the document.
List of top-level (outline / table-of-contents) bookmarks, asynchronously. Bookmarks are organized in a tree-like structure and can have children.
Returns rectangle describing one of the PDF page boxes. If the page box dimension is not present in the PDF document, it's considered to be as large as the actual page size from getPageSize.
Gets the page index for the given page label.
Gets the page label.
Returns a page rotation in degrees.
Returns a page size in PDF points.
Returns text content of the document page.
Returns text content inside given page rectangle.
Returns text content between two character indexes. Use getPageTextLength to determine the number of characters on page.
Gets number of characters in text on the page.
Returns the rects of the range of characters on a page.
Returns the rotation offset applied to this page in degrees.
Returns page text for a list of text blocks. The text is created by sequentially concatenating text blocks with a single space used as a separator.
Returns whether the document has any embedded files.
Checks whether this document has outline / table of contents.
Test document permission flags.
Pre-fetches rotations, sizes and labels for all pages on a background thread. Caching will only be performed once (for the first caller). If you need a callback to be notified of when caching is done, use the async variant initPageCacheAsync instead.
Pre-fetches rotations, sizes and labels for all pages on a background thread. Caching will only be performed once (for the first caller). All subsequent callers suspend until the cache is built, then return.
Invalidates the rendered cache of all the pages for this document. Use this method if the document is not updated after a change, or changed externally, and needs to be re-rendered.
Invalidates the rendered cache of the given pageIndex for this document. Use this method if a single page of the document is not updated after a change, or changed externally, and needs to be re-rendered.
Renders page to a bitmap.
Renders page to a bitmap.
Saves the document to an external file even if it hasn't been changed. Note that this may take a while and should not be called on the main thread. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).
Saves the document to an external file even if it hasn't been changed. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).
Saves the document to original location if it has been changed. If there were no changes to the document, the document file will not be modified. Note that this may take a while and should not be called on the main thread.
Saves the document to passed location if it has been changed. If there were no changes to the document, the output file won't be modified. Note that this may take a while and should not be called on the main thread. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).
Saves the document back to original location if it has been changed. If there were no changes to the document, the document file will not be modified.
Saves the document to an external file if it has been changed. This will not clear the wasModified flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to saveIfModified will still save the document back to the original file).
Applies a temporary rotation to the specified page of this document. This will change the size reported by the document to match the new rotation. The document will not be modified by this. If you plan on applying a rotation to multiple pages use setRotationOffsets.
Applies a temporary rotation to the specified pages of this document. This will change the size reported by the document to match the new rotation. The document will not be modified by this. If you plan on applying a rotation to a single page use setRotationOffset.
Sets the secondary unit value on the document.
Enables or disables filtering of watermark text in text retrieval methods. Note that this will not prevent the rendering of the watermark on the page.
Returns true if this document was modified and should be saved to retain changes.