pub enum Error {
Show 23 variants
InvalidHeader(String),
UnsupportedVersion(String),
ParseError {
offset: usize,
reason: String,
},
ParseWarning {
offset: usize,
message: String,
},
InvalidXref,
ObjectNotFound(u32, u16),
InvalidObjectType {
expected: String,
found: String,
},
UnexpectedEof,
Io(Error),
Utf8Error(Utf8Error),
Unsupported(String),
InvalidPdf(String),
Decode(String),
Encode(String),
UnsupportedFilter(String),
Font(String),
Image(String),
CircularReference(ObjectRef),
RecursionLimitExceeded(u32),
InvalidOperation(String),
LayoutAnalysis(String),
EncryptedPdf,
Type4Runtime(String),
}Expand description
Error types that can occur during PDF processing.
Variants§
InvalidHeader(String)
Invalid PDF header (expected ‘%PDF-’)
UnsupportedVersion(String)
Unsupported PDF version
ParseError
Parse error at specific byte offset
ParseWarning
Parse warning (non-fatal)
InvalidXref
Invalid cross-reference table
ObjectNotFound(u32, u16)
Referenced object not found in cross-reference table
InvalidObjectType
Object has wrong type
UnexpectedEof
Unexpected end of file
Io(Error)
IO error
Utf8Error(Utf8Error)
UTF-8 decoding error
Unsupported(String)
Unsupported feature
InvalidPdf(String)
Invalid PDF structure (generic)
Decode(String)
Stream decoding error
Encode(String)
Encoding error (e.g., image encoding)
UnsupportedFilter(String)
Unsupported stream filter
Font(String)
Font error
Image(String)
Image error
CircularReference(ObjectRef)
Circular reference detected in object graph
RecursionLimitExceeded(u32)
Recursion depth limit exceeded
InvalidOperation(String)
Invalid operation (e.g., calling methods on uninitialized document)
LayoutAnalysis(String)
Layout analysis error
EncryptedPdf
PDF is encrypted and has not been authenticated with the correct password.
This error is returned when attempting to extract content from a PDF that
requires a password. Call authenticate(password) or open with
PdfDocument::open_with_password() before extracting content.
Type4Runtime(String)
Runtime error during PostScript Type 4 function evaluation (stack underflow, typecheck, division by zero, overflow, undefined operations).
Distinct from Error::InvalidPdf, which means a malformed parse;
Type4Runtime means a syntactically valid program failed at execution
time. Callers should typically fall back to a default gray rendering
rather than failing the entire page.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()