pub struct PdfOptions {
pub mode: ProcessMode,
pub detection: DetectionConfig,
pub markdown: MarkdownOptions,
pub page_filter: Option<HashSet<u32>>,
pub password: Option<String>,
}Expand description
Configuration for process_pdf_with_options and friends.
Use the builder methods to customise behaviour:
use pdf_inspector::{PdfOptions, ProcessMode};
let opts = PdfOptions::new()
.mode(ProcessMode::Analyze)
.pages([1, 3, 5]);Fields§
§mode: ProcessModeHow far the pipeline should run (default: ProcessMode::Full).
detection: DetectionConfigDetection configuration.
markdown: MarkdownOptionsMarkdown formatting options (only used in ProcessMode::Full).
page_filter: Option<HashSet<u32>>Optional set of 1-indexed pages to process. None = all pages.
password: Option<String>Password for decrypting an encrypted PDF. None falls back to the
empty password (owner-only encryption).
Implementations§
Source§impl PdfOptions
impl PdfOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Create options with all defaults (ProcessMode::Full).
Sourcepub fn detect_only() -> Self
pub fn detect_only() -> Self
Shorthand for detect-only options.
Sourcepub fn mode(self, mode: ProcessMode) -> Self
pub fn mode(self, mode: ProcessMode) -> Self
Set the processing mode.
Sourcepub fn detection(self, config: DetectionConfig) -> Self
pub fn detection(self, config: DetectionConfig) -> Self
Set detection configuration.
Sourcepub fn markdown(self, options: MarkdownOptions) -> Self
pub fn markdown(self, options: MarkdownOptions) -> Self
Set markdown formatting options.
Sourcepub fn pages(self, pages: impl IntoIterator<Item = u32>) -> Self
pub fn pages(self, pages: impl IntoIterator<Item = u32>) -> Self
Limit processing to specific 1-indexed pages.
Trait Implementations§
Source§impl Clone for PdfOptions
impl Clone for PdfOptions
Source§impl Debug for PdfOptions
impl Debug for PdfOptions
Auto Trait Implementations§
impl Freeze for PdfOptions
impl RefUnwindSafe for PdfOptions
impl Send for PdfOptions
impl Sync for PdfOptions
impl Unpin for PdfOptions
impl UnsafeUnpin for PdfOptions
impl UnwindSafe for PdfOptions
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> 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> ⓘ
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