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),
Barcode(String),
EncryptedPdf,
}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
Barcode(String)
Barcode/QR code generation 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.
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()
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more