pub struct LopdfExtractor;Expand description
Pure Rust PDF image extractor using lopdf
This extractor works without external tools by directly extracting embedded JPEG images from the PDF. Works best with scanned PDFs where each page is a single JPEG image (DCTDecode filter).
Implementations§
Source§impl LopdfExtractor
impl LopdfExtractor
Sourcepub fn extract_all(
pdf_path: &Path,
output_dir: &Path,
_options: &ExtractOptions,
) -> Result<Vec<ExtractedPage>>
pub fn extract_all( pdf_path: &Path, output_dir: &Path, _options: &ExtractOptions, ) -> Result<Vec<ExtractedPage>>
Extract all embedded JPEG images from a PDF
This method extracts XObject images with DCTDecode filter (JPEG). For scanned PDFs, this typically means one JPEG per page.
Sourcepub fn magick_available() -> bool
pub fn magick_available() -> bool
Check if ImageMagick is available
Sourcepub fn pdftoppm_available() -> bool
pub fn pdftoppm_available() -> bool
Check if pdftoppm (poppler-utils) is available
Sourcepub fn extract_auto(
pdf_path: &Path,
output_dir: &Path,
options: &ExtractOptions,
) -> Result<Vec<ExtractedPage>>
pub fn extract_auto( pdf_path: &Path, output_dir: &Path, options: &ExtractOptions, ) -> Result<Vec<ExtractedPage>>
Extract using best available method
Auto Trait Implementations§
impl Freeze for LopdfExtractor
impl RefUnwindSafe for LopdfExtractor
impl Send for LopdfExtractor
impl Sync for LopdfExtractor
impl Unpin for LopdfExtractor
impl UnwindSafe for LopdfExtractor
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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