pub struct Permissions {
pub print: bool,
pub modify: bool,
pub copy: bool,
pub annotate: bool,
pub fill_forms: bool,
pub accessibility: bool,
pub assemble: bool,
pub print_hires: bool,
}Expand description
The eight standard-handler permission bits a document opened under the
user password (rather than the owner password) is granted (ISO 32000-2
§7.6.4.2, Table 22). Bits the standard reserves are not represented
here; p_value fixes them to the values it mandates.
Fields§
§print: boolPrint the document, at full quality only when print_hires is also
set (Table 22 bit 3).
modify: boolModify the document’s contents, beyond what annotate,
fill_forms and assemble separately cover (Table 22 bit 4).
copy: boolCopy or otherwise extract text and graphics (Table 22 bit 5).
annotate: boolAdd or modify text annotations and fill form fields (Table 22 bit 6).
fill_forms: boolFill in existing form fields even without annotate (Table 22 bit
9).
accessibility: boolExtract text and graphics for accessibility (Table 22 bit 10).
assemble: boolAssemble the document: insert, rotate or delete pages, create bookmarks or thumbnails (Table 22 bit 11).
print_hires: boolPrint at full quality; without it, printing (if print allows it)
may be limited to a low-resolution rasterization (Table 22 bit 12).
Implementations§
Source§impl Permissions
impl Permissions
Sourcepub fn all() -> Permissions
pub fn all() -> Permissions
Every permission granted.
Sourcepub fn from_names<'a>(
names: impl IntoIterator<Item = &'a str>,
) -> Result<Permissions, String>
pub fn from_names<'a>( names: impl IntoIterator<Item = &'a str>, ) -> Result<Permissions, String>
Every permission named in names granted, everything else denied.
The first name not in PERMISSION_NAMES comes back as Err,
carrying that name alone: the CLI and the Python bindings each wrap
it in their own error type and message text.
Trait Implementations§
Source§impl Clone for Permissions
impl Clone for Permissions
impl Copy for Permissions
Source§impl Debug for Permissions
impl Debug for Permissions
Source§impl Default for Permissions
impl Default for Permissions
Source§fn default() -> Permissions
fn default() -> Permissions
Every permission granted, same as Permissions::all.