pub struct Permissions { /* private fields */ }Expand description
Permissions granted on an encrypted PDF.
Construct via presets (Permissions::full_access,
Permissions::print_only, Permissions::read_only,
Permissions::annotate) or the individual with_* methods for fine
control.
§Accessibility
All presets enable extract_accessibility. Per ISO 32000-2 §7.6.4.2,
a PDF consumer is required to honour accessibility-extraction regardless
of the author’s permission bits. Setting extract_accessibility = false
via Permissions::with_extract_accessibility is therefore advisory; a
spec-compliant reader will still allow screen-reader access.
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub const fn full_access() -> Self
pub const fn full_access() -> Self
All permissions allowed. Use this when you only want encryption for confidentiality, not to restrict what authorised readers can do.
Sourcepub const fn print_only() -> Self
pub const fn print_only() -> Self
Printing allowed (including high-quality); all other operations denied. Accessibility-extraction remains enabled per ISO 32000-2.
Sourcepub const fn read_only() -> Self
pub const fn read_only() -> Self
All operations denied. Accessibility-extraction remains enabled per ISO 32000-2 — assistive technologies retain access to the content.
Sourcepub const fn annotate() -> Self
pub const fn annotate() -> Self
Allow commenting, form filling, copying, and printing. Denies document-structure modification and page assembly.
Sourcepub const fn with_print(self, v: bool) -> Self
pub const fn with_print(self, v: bool) -> Self
Allow / deny printing (low resolution).
Sourcepub const fn with_modify(self, v: bool) -> Self
pub const fn with_modify(self, v: bool) -> Self
Allow / deny modification.
Sourcepub const fn with_annotate(self, v: bool) -> Self
pub const fn with_annotate(self, v: bool) -> Self
Allow / deny adding/editing annotations.
Sourcepub const fn with_fill_forms(self, v: bool) -> Self
pub const fn with_fill_forms(self, v: bool) -> Self
Allow / deny filling form fields.
Sourcepub const fn with_extract_accessibility(self, v: bool) -> Self
pub const fn with_extract_accessibility(self, v: bool) -> Self
Allow / deny accessibility extraction (screen readers).
Sourcepub const fn with_assemble(self, v: bool) -> Self
pub const fn with_assemble(self, v: bool) -> Self
Allow / deny assembling (insert/rotate/delete pages).
Sourcepub const fn with_print_high_quality(self, v: bool) -> Self
pub const fn with_print_high_quality(self, v: bool) -> Self
Allow / deny high-resolution printing.
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
impl Copy for Permissions
Auto Trait Implementations§
impl Freeze for Permissions
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnsafeUnpin for Permissions
impl UnwindSafe for Permissions
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreimpl<T> ParallelSend for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.