loadDocument function

Pointer<FPDF_DOCUMENT> loadDocument (
  1. String filePath,
  2. {String password}
)

Implementation

Pointer<FPDF_DOCUMENT> loadDocument(String filePath, {String password}) {
  var doc = fLoadDocument(Utf8.toUtf8(filePath), Utf8.toUtf8(password ?? ""));
  if (doc == nullptr) {
    var err = fGetLastError();
    throw PdfiumException.fromErrorCode(err);
  }
  return doc;
}