loadDocument method

  1. @override
Future<PdfDocument> loadDocument(
  1. PdfDocumentLoaderProgressCallback progressCallback,
  2. PdfDocumentLoaderReportCallback reportCallback
)
override

Use resolveListenable/PdfDocumentListenable.document instead to load the shared PdfDocument.

Direct use of the function also works but it loads the document every time and it results in more memory usage.

Classes that extends PdfDocumentRef should override this function to load the document.

progressCallback should be called when the document is loaded from remote source to notify the progress.

Implementation

@override
Future<PdfDocument> loadDocument(
  PdfDocumentLoaderProgressCallback progressCallback,
  PdfDocumentLoaderReportCallback reportCallback,
) =>
    Future.value(document);