pub enum ExtractError {
Pdf(Error),
Io(Error),
PageOutOfRange(u32, u32),
UnsupportedFilter(String),
ImageDecode(String),
Other(String),
}Expand description
Errors returned by the pdf-extract crate while reading text or images
from a PDF.
Customers usually see these wrapped inside pdfluent::Error after they
bubble up through the facade. The inner variant tells the caller what
kind of input prevented extraction.
Variants§
Pdf(Error)
The underlying PDF byte stream could not be parsed.
Typically a malformed cross-reference table, a truncated stream, or
an unsupported PDF construct. The wrapped lopdf::Error has the
detail; surface it to the user when reporting the problem.
Io(Error)
An I/O error occurred while reading the document or writing extracted output (for image extraction targets).
PageOutOfRange(u32, u32)
The caller asked for a page index that does not exist in the document.
Fields: (requested_page, total_pages). Page numbers are 1-based at
the public API; this variant carries the same convention.
UnsupportedFilter(String)
The image embedded on the page uses a PDF stream filter that this crate cannot decode (for example uncommon JPX profiles or unknown custom filters). The wrapped string identifies the filter by its PDF name.
ImageDecode(String)
Image bytes were extracted but could not be decoded by the image backend (corrupt JPEG/PNG/JPX payload, invalid colorspace, etc.).
Other(String)
A non-categorised extraction failure. Reserved for cases the more specific variants do not cover; the message describes the situation.
Trait Implementations§
Source§impl Debug for ExtractError
impl Debug for ExtractError
Source§impl Display for ExtractError
impl Display for ExtractError
Source§impl Error for ExtractError
impl Error for ExtractError
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()
Source§impl From<Error> for ExtractError
impl From<Error> for ExtractError
Auto Trait Implementations§
impl Freeze for ExtractError
impl !RefUnwindSafe for ExtractError
impl Send for ExtractError
impl Sync for ExtractError
impl Unpin for ExtractError
impl UnsafeUnpin for ExtractError
impl !UnwindSafe for ExtractError
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