getPage method

  1. @override
Future<Uint8List> getPage(
  1. int pageNumber,
  2. int fullWidth,
  3. int fullHeight,
  4. String documentID,
)

Gets the image bytes of the specified page from the document at the specified width and .

Implementation

@override
Future<Uint8List> getPage(
    int pageNumber, int fullWidth, int fullHeight, String documentID) async {
  if (_documentRepo[documentID] != null) {
    PdfJsPage page =
        await (_documentRepo[documentID]!.getPage(pageNumber)).toDart;
    PdfJsViewport viewport = page.getViewport(_settings);
    return renderPage(page, viewport, fullWidth, fullHeight, documentID);
  }
  return Uint8List.fromList(<int>[0]);
}