pdfPage method

Future<UPdfPage?> pdfPage(
  1. int index
)

Implementation

Future<UPdfPage?> pdfPage(int index) async {
  final UPdfPage? cached = _pages[index];
  if (cached != null) return cached;
  final UPdfDocument? document = _document;
  if (document == null) return null;
  final UPdfPage? page = await document.page(index);
  if (page == null) return null;
  if (_pages.length > 512) _pages.clear();
  _pages[index] = page;
  _infos[index] = _infoFor(page);
  return page;
}