PdfDocument class abstract

Handles PDF document loaded on memory.

Constructors

PdfDocument({required String sourceName})

Properties

hashCode int
The hash code for this object.
no setterinherited
isEncrypted bool
Determine whether the PDF file is encrypted or not.
no setter
pages List<PdfPage>
Pages.
no setter
permissions PdfPermissions?
Permission flags.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceName String
File path, asset:[ASSET_PATH] or memory: depending on the content opened.
final

Methods

dispose() Future<void>
isIdenticalDocumentHandle(Object? other) bool
Determine whether document handles are identical or not.
loadOutline() Future<List<PdfOutlineNode>>
Load outline (a.k.a. bookmark).
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 Methods

openAsset(String name, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true}) Future<PdfDocument>
Opening the specified asset.
openCustom({required FutureOr<int> read(Uint8List buffer, int position, int size), required int fileSize, required String sourceName, PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true, int? maxSizeToCacheOnMemory, void onDispose()?}) Future<PdfDocument>
Opening the PDF from custom source.
openData(Uint8List data, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true, String? sourceName, void onDispose()?}) Future<PdfDocument>
Opening the PDF on memory.
openFile(String filePath, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true}) Future<PdfDocument>
Opening the specified file. For Web, filePath can be relative path from index.html or any arbitrary URL but it may be restricted by CORS.
openUri(Uri uri, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true, PdfDownloadProgressCallback? progressCallback, PdfDownloadReportCallback? reportCallback, bool preferRangeAccess = false, Map<String, String>? headers, bool withCredentials = false}) Future<PdfDocument>
Opening the PDF from URI.