pub struct ParseOptions {
pub error_mode: ErrorMode,
pub extract_mode: ExtractMode,
pub extract_resources: bool,
pub min_image_dimension: u32,
pub parallel: bool,
pub pages: PageSelection,
pub password: Option<String>,
}Expand description
Options for parsing PDF documents.
Fields§
§error_mode: ErrorModeError handling mode
extract_mode: ExtractModeWhat to extract from the document
extract_resources: boolWhether to extract embedded resources (images, fonts).
Default is false since 0.4.0 — large PDFs silently loading all
images into memory was the largest peak-memory vector. Opt in via
.with_resources(true) when images are needed.
min_image_dimension: u32Minimum pixel dimension for extracted images. Images whose width OR height falls below this threshold are dropped as decorative (logos, bullets, rule lines, tracking pixels). Set to 0 to keep every image. Default 64 — conservative cutoff for technical docs.
parallel: boolWhether to use parallel processing
pages: PageSelectionPage selection (which pages to parse)
password: Option<String>Password for encrypted documents
Implementations§
Source§impl ParseOptions
impl ParseOptions
Sourcepub fn with_error_mode(self, mode: ErrorMode) -> Self
pub fn with_error_mode(self, mode: ErrorMode) -> Self
Set error mode.
Sourcepub fn with_extract_mode(self, mode: ExtractMode) -> Self
pub fn with_extract_mode(self, mode: ExtractMode) -> Self
Set extract mode.
Sourcepub fn with_resources(self, extract: bool) -> Self
pub fn with_resources(self, extract: bool) -> Self
Enable or disable resource extraction.
Sourcepub fn with_parallel(self, parallel: bool) -> Self
pub fn with_parallel(self, parallel: bool) -> Self
Enable or disable parallel processing.
Sourcepub fn sequential(self) -> Self
pub fn sequential(self) -> Self
Disable parallel processing.
Sourcepub fn with_pages(self, pages: PageSelection) -> Self
pub fn with_pages(self, pages: PageSelection) -> Self
Set page selection.
Sourcepub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
Set password for encrypted documents.
Sourcepub fn with_min_image_dimension(self, min_px: u32) -> Self
pub fn with_min_image_dimension(self, min_px: u32) -> Self
Set the minimum image dimension (pixels). Images with width OR
height below this value are dropped as decorative. 0 keeps all.
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
Source§impl From<&ParseOptions> for PageStreamOptions
impl From<&ParseOptions> for PageStreamOptions
Source§fn from(o: &ParseOptions) -> Self
fn from(o: &ParseOptions) -> Self
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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