PdfDocumentRef class abstract
PdfDocumentRef controls loading of a PdfDocument and it also provide you with a way to use PdfDocument safely in your long running async operations.
There are several types of PdfDocumentRefs predefined:
- PdfDocumentRefAsset loads the document from asset.
- PdfDocumentRefUri loads the document from network.
- PdfDocumentRefFile loads the document from file.
- PdfDocumentRefData loads the document from data in Uint8List.
- PdfDocumentRefCustom loads the document from custom source.
- PdfDocumentRefDirect directly contains PdfDocument.
Or you can create your own PdfDocumentRef by extending the class.
The following fragment explains how to get PdfDocument using PdfDocumentRef:
await documentRef.resolveListenable().useDocument(
(document) async {
// Use the document here
},
);
Constructors
- PdfDocumentRef({bool autoDispose = true})
-
const
Properties
- autoDispose → bool
-
Whether to dispose the document on reference dispose or not.
final
- hashCode → int
-
Classes that extends PdfDocumentRef should override this function.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceName → String
-
Source name to identify the reference.
no setter
Methods
-
loadDocument(
PdfDocumentLoaderProgressCallback progressCallback, PdfDocumentLoaderReportCallback reportCallback) → Future< PdfDocument> - Use resolveListenable/PdfDocumentListenable.document instead to load the shared PdfDocument.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolveListenable(
) → PdfDocumentListenable - Resolve the PdfDocumentListenable for this reference.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Classes that extends PdfDocumentRef should override this function to compare the equality by sourceName
or such.
override