Pspdfkit class

PSPDFKit plugin to load PDF and image documents on both platform iOS and Android.

Constructors

Pspdfkit()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

authorName String
Get the annotation author name.
getter/setter pair
defaultWebToolbarItems List<PspdfkitWebToolbarItem>
Get default Web main toolbar items.
no setter
flutterPdfActivityOnPause VoidCallback?
onPause callback for FlutterPdfActivity. Only available on Android.
no getter
flutterPdfFragmentAdded VoidCallback?
called when a PdfFragment is added. Only available on Android.
no getter
frameworkVersion Future<String?>
Gets the PSPDFKit framework version.
no setter
instantAuthenticationFailed ← InstantAuthenticationFailedCallback?
Called when instant authentication fails.
no getter
instantAuthenticationFinished ← InstantAuthenticationFinishedCallback?
Called when instant authentication is done.
no getter
instantDownloadFailed ← InstantDownloadFailedCallback?
Called when instant document download fails. Only available on iOS.
no getter
instantDownloadFinished ← InstantDownloadFinishedCallback?
Called when instant document download is done.Only available on iOS.
no getter
instantSyncFailed ← InstantSyncFailedCallback?
Called when instant synchronization fails.
no getter
instantSyncFinished ← InstantSyncFinishedCallback?
Called when instant synchronization ends.
no getter
instantSyncStarted ← InstantSyncStartedCallback?
Called when instant synchronization starts.
no getter
pdfViewControllerDidDismiss VoidCallback?
ViewControllerDidDismiss callback for PDFViewController. Only available on iOS.
no getter
pdfViewControllerWillDismiss VoidCallback?
ViewControllerWillDismiss callback for PDFViewController. Only available on iOS.
no getter
pspdfkitDocumentLoaded ← PspdfkitDocumentLoadedCallback?
Called when a document is loaded.
no getter
useLegacy bool
getter/setter pair

Static Methods

addAnnotation(dynamic jsonAnnotation) Future<bool?>
Adds the given annotation to the presented document. jsonAnnotation can either be a JSON string or a valid JSON Dictionary (iOS) / HashMap (Android).
applyInstantJson(String annotationsJson) Future<bool?>
Applies Instant document JSON to the presented document.
checkAndroidWriteExternalStoragePermission() Future<bool?>
Checks the external storage permission for writing on Android only.
exportInstantJson() Future<String?>
Exports Instant document JSON from the presented document.
exportXfdf(String xfdfPath) Future<bool?>
Exports annotations to the XFDF file at the given path.
generatePdf(List<NewPage> pages, String outPutFile, [dynamic options]) Future<String?>
generatePdfFromHtmlString(String html, String outPutFile, [dynamic options]) Future<String?>
generatePdfFromHtmlUri(Uri htmlUri, String outPutFile, [dynamic options]) Future<String?>
getAllUnsavedAnnotations() Future
Returns a list of JSON dictionaries for all the unsaved annotations in the presented document.
getAnnotations(int pageIndex, String type) Future
Returns a list of JSON dictionaries for all the annotations of the given type on the given pageIndex.
getFormFieldValue(String fullyQualifiedName) Future<String?>
Gets the form field value by specifying its fully qualified name.
getTemporaryDirectory() Future<Directory>
Path to the temporary directory on the device that is not backed up and is suitable for storing caches of downloaded files.
importXfdf(String xfdfPath) Future<bool?>
Imports annotations from the XFDF file at the given path.
initialize({String? androidLicenseKey, String? iosLicenseKey, String? webLicenseKey, bool? useLegacy}) Future<void>
openAndroidSettings() Future<void>
Opens the Android settings.
present(String document, {dynamic configuration, MeasurementScale? measurementScale, MeasurementPrecision? measurementPrecision}) Future<bool?>
Loads a document with a supported format using a given configuration.
presentInstant(String serverUrl, String jwt, [dynamic configuration]) Future<bool?>
Loads an Instant document from a server serverUrl with using a jwt in a native Instant PDFViewer.
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 jsonAnnotation) Future<bool?>
Removes the given annotation from the presented document. jsonAnnotation can either be a JSON string or a valid JSON Dictionary (iOS) / HashMap (Android).
requestAndroidWriteExternalStoragePermission() Future<AndroidPermissionStatus>
Requests the external storage permission for writing on Android only.
save() 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.
setAnnotationPresetConfigurations(Map<String, dynamic> configurations) Future<bool?>
setDelayForSyncingLocalChanges(double delay) Future<bool?>
Sets a delay for synchronizing local changes to the Instant Server (PSPDFKit Document Engine). delay is the delay in milliseconds.
setFormFieldValue(String value, String fullyQualifiedName) Future<bool?>
Sets the value of a form field by specifying its fully qualified field name.
setLicenseKey(String? licenseKey) Future<void>
Sets the license key. @param licenseKey The license key to be used.
setLicenseKeys(String? androidLicenseKey, String? iOSLicenseKey, String? webLicenseKey) Future<void>
Sets the license keys for both platforms.
setListenToServerChanges(bool listen) Future<bool?>
Enable or disable listening to Instant Server (PSPDFKit Document Engine) changes.
syncAnnotations() Future<bool?>
Manually triggers synchronization.