loadPage method

PdfiumWrap loadPage(
  1. int index
)

Loads a page from a document loaded

Throws an PdfiumException if the no document is loaded, and a PageException if the page being attempted to load does not exist. Returns a instance of PdfiumWrap

Implementation

PdfiumWrap loadPage(int index) {
  if (_document == nullptr) {
    throw PdfiumException(message: 'Document not load');
  }
  _page = pdfium.FPDF_LoadPage(_document!, index);
  if (_page == nullptr) {
    final err = pdfium.getLastErrorMessage();
    throw PageException(message: err);
  }
  return this;
}