PdfDocument class abstract

Handles PDF document loaded on memory.

Constructors

PdfDocument.new({required String sourceName})
Constructor to force initialization of 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>
PdfDocument must have dispose function.
isIdenticalDocumentHandle(Object? other) bool
Determine whether document handles are identical or not.
loadOutline() Future<List<PdfOutlineNode>>
Load outline (a.k.a. bookmark).
loadPagesProgressively<T>(PdfPageLoadingCallback<T>? onPageLoadProgress, {T? data, Duration loadUnitDuration = const Duration(milliseconds: 250)}) Future<void>
Load pages progressively.
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, bool useProgressiveLoading = false}) 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, bool useProgressiveLoading = false, int? maxSizeToCacheOnMemory, void onDispose()?}) Future<PdfDocument>
Opening the PDF from custom source.
openData(Uint8List data, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true, bool useProgressiveLoading = false, String? sourceName, bool allowDataOwnershipTransfer = false, void onDispose()?}) Future<PdfDocument>
Opening the PDF on memory.
openFile(String filePath, {PdfPasswordProvider? passwordProvider, bool firstAttemptByEmptyPassword = true, bool useProgressiveLoading = false}) 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, bool useProgressiveLoading = false, PdfDownloadProgressCallback? progressCallback, bool preferRangeAccess = false, Map<String, String>? headers, bool withCredentials = false}) Future<PdfDocument>
Opening the PDF from URI.