PdfDocument class abstract

Implementers

Constructors

PdfDocument({required String documentId})

Properties

documentId String
final
hashCode int
The hash code for this object.
no setterinherited
isHeadless bool
Whether this document was opened in headless mode (without a viewer).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAnnotation(dynamic annotation, [Map<String, dynamic>? attachment]) Future<bool?>
Adds an annotation to the presented document.
addAnnotations(List<Annotation> annotations) Future<void>
Used to add multiple annotations at once. Does not trigger annotationCreated or annotationUpdated events. annotations A list of Annotation objects to add. Returns Future that completes when the annotations have been added.
addBookmark(Bookmark bookmark) Future<Bookmark>
Adds a new bookmark to the document.
androidClearBookmarkDirtyState(String bookmarkId) Future<bool>
Android only. Clears the dirty state of a specific bookmark.
androidGetBookmarkIsDirty(String bookmarkId) Future<bool>
Android only. Gets the dirty state of a specific bookmark.
androidGetFormFieldIsDirty(String fullyQualifiedName) Future<bool>
Android only. Gets the dirty state of a form field.
androidHasUnsavedAnnotationChanges() Future<bool>
Android only. Checks if the annotation provider has unsaved changes.
androidHasUnsavedBookmarkChanges() Future<bool>
Android only. Checks if the bookmark provider has unsaved changes.
androidHasUnsavedFormChanges() Future<bool>
Android only. Checks if the form provider has unsaved changes.
applyInstantJson(String annotationsJson) Future<bool?>
Applies Instant document JSON to the presented document.
close() Future<bool>
Closes the document and releases all native resources.
exportInstantJson() Future<String?>
Exports Instant document JSON from the presented document.
exportPdf({DocumentSaveOptions? options}) Future<Uint8List>
Exports the document as a PDF. options:DocumentSaveOptions The options to use when exporting the document. Returns a Uint8List containing the exported PDF data.
exportXfdf(String xfdfPath) Future<bool>
Exports annotations to the XFDF file at the given path.
getAllUnsavedAnnotations() Future<Object>
Returns a list of JSON dictionaries for all the unsaved annotations in the presented document.
getAnnotationProperties(int pageIndex, String annotationId) Future<AnnotationProperties?>
Gets annotation properties for modification. Returns null if the annotation doesn't exist.
getAnnotations(int pageIndex, AnnotationType type) Future<List<Annotation>>
Internal method to remove an annotation using JSON string Returns a list of JSON dictionaries for all the annotations of the given type on the given pageIndex.
getAnnotationsAsJson(int pageIndex, AnnotationType type) Future
Returns a JSON string for all the annotations of the given type on the given pageIndex.
getBookmarks() Future<List<Bookmark>>
Gets all bookmarks in the document.
getBookmarksForPage(int pageIndex) Future<List<Bookmark>>
Gets bookmarks for a specific page.
getFormField(String fieldName) Future<PdfFormField>
Returns the form field with the given name.
getFormFields() Future<List<PdfFormField>>
Returns a list of all form fields in the document.
getFormFieldValue(String fullyQualifiedName) Future<String?>
Gets the form field value by specifying its fully qualified name.
getPageCount() Future<int>
Get number of pages in the document. Returns the number of pages in the document.
getPageInfo(int pageIndex) Future<PageInfo>
Returns the page info for the given page index. pageIndex The index of the page. This is a zero-based index.
getUnsavedAnnotations() Future<List<Annotation>>
Returns a list of annotation models for all the unsaved annotations in the presented document.
hasBookmarkForPage(int pageIndex) Future<bool>
Checks if a bookmark exists for a specific page.
hasUnsavedChanges() Future<bool>
Checks if the document has any unsaved changes.
importXfdf(String xfdfString) Future<bool>
Imports annotations from the XFDF file at the given path.
iOSClearNeedsSaveFlag() Future<bool>
iOS only. Clears the dirty state on all annotations.
iOSGetAnnotationIsDirty(int pageIndex, String annotationId) Future<bool>
iOS only. Gets the dirty state of a specific annotation.
iOSHasDirtyAnnotations() Future<bool>
iOS only. Checks if the document has any dirty (unsaved) annotations.
iOSSetAnnotationIsDirty(int pageIndex, String annotationId, bool isDirty) Future<bool>
iOS only. Sets the dirty state of a specific annotation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processAnnotations(AnnotationType type, AnnotationProcessingMode processingMode, String destinationPath) Future<bool>
Processes annotations of the given type with the provided processing mode and stores the PDF at the given destination path.
removeAnnotation(dynamic annotation) Future<bool?>
Removes an annotation from the presented document.
removeBookmark(Bookmark bookmark) Future<bool>
Removes a bookmark from the document.
save({String? outputPath, DocumentSaveOptions? options}) Future<bool>
Saves the document back to its original location if it has been changed. If there were no changes to the document, the document file will not be modified.
saveAnnotationProperties(AnnotationProperties properties) Future<bool>
Saves modified annotation properties. Only non-null properties in properties will be updated. All other properties (including attachments and custom data) are preserved.
searchAnnotations(String query, [int? pageIndex]) Future<List<Annotation>>
Searches for annotations containing specific text.
setFormFieldValue(String value, String fullyQualifiedName) Future<bool?>
Sets the value of a form field by specifying its fully qualified field name.
toString() String
A string representation of this object.
inherited
updateAnnotation(Annotation annotation) Future<void>
Updates the given annotation model in the presented document.
updateBookmark(Bookmark bookmark) Future<bool>
Updates an existing bookmark.
webHasUnsavedChanges() Future<bool>
Web only. Checks if the instance has unsaved changes.

Operators

operator ==(Object other) bool
The equality operator.
inherited