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
impl PdfFile
pub fn load(data: Vec<u8>, password: Option<&str>) -> Result<Self>
pub fn data(&self) -> &[u8] ⓘ
Sourcepub fn get(&self, num: u32) -> Arc<Object> ⓘ
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.
Sourcepub fn resolve(&self, obj: &Object) -> Object
pub fn resolve(&self, obj: &Object) -> Object
Resolves an object one level: a Ref becomes its target, everything else is cloned.
Sourcepub fn decode_stream(&self, stream: &Stream) -> Result<Decoded>
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§
impl !Freeze for PdfFile
impl Forget for PdfFile
impl Move for PdfFile
impl RefUnwindSafe for PdfFile
impl Send for PdfFile
impl Sync for PdfFile
impl Unpin for PdfFile
impl UnsafeUnpin for PdfFile
impl UnwindSafe for PdfFile
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