pub struct LoadOptions {
pub password: Option<String>,
pub filter: Option<FilterFunc>,
pub strict: bool,
}Expand description
Options for loading PDF documents.
Use this struct to configure password, object filtering, and strictness when loading a PDF. The default is lenient parsing with no password or filter.
§Examples
ⓘ
use lopdf::{Document, LoadOptions};
// Load with a password
let doc = Document::load_with_options(
"encrypted.pdf",
LoadOptions::with_password("secret"),
);
// Load with strict parsing
let doc = Document::load_with_options(
"document.pdf",
LoadOptions { strict: true, ..Default::default() },
);Fields§
§password: Option<String>Password for encrypted PDFs.
filter: Option<FilterFunc>Object filter applied during loading.
strict: boolWhen true, reject non-conforming PDFs instead of silently accepting them.
Defaults to false (lenient parsing).
Implementations§
Source§impl LoadOptions
impl LoadOptions
Sourcepub fn with_password(password: &str) -> Self
pub fn with_password(password: &str) -> Self
Create options with a password for encrypted PDFs.
Sourcepub fn with_filter(filter: FilterFunc) -> Self
pub fn with_filter(filter: FilterFunc) -> Self
Create options with an object filter.
Trait Implementations§
Source§impl Clone for LoadOptions
impl Clone for LoadOptions
Source§impl Debug for LoadOptions
impl Debug for LoadOptions
Auto Trait Implementations§
impl Freeze for LoadOptions
impl RefUnwindSafe for LoadOptions
impl Send for LoadOptions
impl Sync for LoadOptions
impl Unpin for LoadOptions
impl UnsafeUnpin for LoadOptions
impl UnwindSafe for LoadOptions
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