PdfExtractionException class

Thrown when a PDF operation fails.

The error field provides the reason for the failure. Callers should handle PdfError.passwordRequired and PdfError.invalidDocument separately to give users actionable error messages.

Example:

try {
  final doc = await PdfDocument.fromBytes(bytes);
} on PdfExtractionException catch (e) {
  if (e.error == PdfError.passwordRequired) {
    // prompt user for a password
  } else {
    // report a corrupt or invalid file
  }
}
Implemented types

Constructors

PdfExtractionException(PdfError error)
Creates a PdfExtractionException with the given error.
const

Properties

error PdfError
The reason for the failure.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited