pub struct LoadOptions {
pub password: Option<String>,
pub filter: Option<fn((u32, u16), &mut Object) -> Option<((u32, u16), Object)>>,
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<fn((u32, u16), &mut Object) -> Option<((u32, u16), Object)>>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) -> LoadOptions
pub fn with_password(password: &str) -> LoadOptions
Create options with a password for encrypted PDFs.
Trait Implementations§
Source§impl Clone for LoadOptions
impl Clone for LoadOptions
Source§fn clone(&self) -> LoadOptions
fn clone(&self) -> LoadOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoadOptions
impl Debug for LoadOptions
Source§impl Default for LoadOptions
impl Default for LoadOptions
Source§fn default() -> LoadOptions
fn default() -> LoadOptions
Returns the “default value” for a type. Read more
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