Skip to main content

PdfFile

Struct PdfFile 

Source
pub struct PdfFile {
    pub trailer: Dict,
    pub decryptor: Option<Decryptor>,
    /* private fields */
}
Expand description

The parsed file: bytes plus the object map. All access is by object number.

Interior caches are mutex-guarded, so &PdfFile is usable from multiple threads.

Fields§

§trailer: Dict§decryptor: Option<Decryptor>

Implementations§

Source§

impl PdfFile

Source

pub fn load(data: Vec<u8>, password: Option<&str>) -> Result<Self>

Source

pub fn data(&self) -> &[u8] ⓘ

Source

pub fn get(&self, num: u32) -> Arc<Object> ⓘ

Fetches object num, from cache when possible. Returns Object::Null for anything missing or malformed: a dangling reference is data-level damage, not a hard error.

Source

pub fn resolve(&self, obj: &Object) -> Object

Resolves an object one level: a Ref becomes its target, everything else is cloned.

Source

pub fn decode_stream(&self, stream: &Stream) -> Result<Decoded>

Decodes a stream’s filter chain (after any decryption, which happened at load).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.