fromBytes static method
Loads a PDF document from raw bytes.
Returns a PdfDocument on success.
Throws PdfExtractionException with:
- PdfError.passwordRequired if the document is password-protected.
- PdfError.invalidDocument if the bytes are corrupt or not a valid PDF.
The optional dylibPath overrides the default PDFium dynamic library
location. It is intended for testing only.
Implementation
static Future<PdfDocument> fromBytes(
Uint8List bytes, {
String? dylibPath,
}) async {
final impl = await PdfDocumentImpl.fromBytes(bytes, dylibPath: dylibPath);
return PdfDocument._(impl);
}