pub struct Document { /* private fields */ }Expand description
a PDF document opened for reading
Implementations§
Source§impl Document
impl Document
Sourcepub fn named_dest(&self, name: &str) -> Option<Dest>
pub fn named_dest(&self, name: &str) -> Option<Dest>
a named destination (“chapter1”)
Sourcepub fn annotations(&self, page: usize) -> Result<Vec<Annotation>, Error>
pub fn annotations(&self, page: usize) -> Result<Vec<Annotation>, Error>
the annotations of a page
Sourcepub fn links(&self, page: usize) -> Result<Vec<([f64; 4], Action)>, Error>
pub fn links(&self, page: usize) -> Result<Vec<([f64; 4], Action)>, Error>
the links of a page: (rectangle, action)
Sourcepub fn fields(&self) -> Vec<Field>
pub fn fields(&self) -> Vec<Field>
the fields of the interactive form (the AcroForm), terminal fields only
Sourcepub fn attachments(&self) -> Vec<Attachment>
pub fn attachments(&self) -> Vec<Attachment>
the embedded files: the /EmbeddedFiles name tree, then file attachment annotations
Sourcepub fn page_label(&self, page: usize) -> Option<String>
pub fn page_label(&self, page: usize) -> Option<String>
a page’s label (12.4.2: “iv”, “A-3”); None when the document sets no labels
Source§impl Document
impl Document
Source§impl Document
impl Document
pub fn open_with(data: Vec<u8>, opt: &Options) -> Result<Document, Error>
Sourcepub fn version(&self) -> (u8, u8)
pub fn version(&self) -> (u8, u8)
the version of the header, or of the catalog’s /Version when that is newer
pub fn is_encrypted(&self) -> bool
Sourcepub fn permissions(&self) -> Option<u32>
pub fn permissions(&self) -> Option<u32>
the permission bits /P of an encrypted file (ISO 32000-1, Table 22: bit 3 print, 4 modify, 5 copy text and graphics, 6 annotate, 9 fill in forms, 10 extract for accessibility, 11 assemble, 12 print in high quality; counted from 1)
Sourcepub fn encryption_revision(&self) -> Option<u8>
pub fn encryption_revision(&self) -> Option<u8>
the revision of the standard security handler (2 to 6) of an encrypted file
Sourcepub fn opened_as_owner(&self) -> bool
pub fn opened_as_owner(&self) -> bool
the password given was the owner password
Sourcepub fn was_repaired(&self) -> bool
pub fn was_repaired(&self) -> bool
the cross-reference was rebuilt from the objects of the file
pub fn trailer(&self) -> &Dict
Sourcepub fn get(&self, r: Ref) -> Object
pub fn get(&self, r: Ref) -> Object
an indirect object (Null when it is missing, as ISO 32000 has it)
Sourcepub fn resolve(&self, o: &Object) -> Object
pub fn resolve(&self, o: &Object) -> Object
follow references until an object that is none (Null after too many)
pub fn decode(&self, s: &Stream) -> Result<Vec<u8>, Error>
Sourcepub fn decode_until_image(
&self,
s: &Stream,
) -> Result<(Vec<u8>, Option<(Name, Dict)>), Error>
pub fn decode_until_image( &self, s: &Stream, ) -> Result<(Vec<u8>, Option<(Name, Dict)>), Error>
a stream’s data with its filters applied up to an image filter: the data, and the image filter with its parameters (DCTDecode is a JPEG file then, JPXDecode a JPEG 2000 one)
pub fn page_count(&self) -> usize
pub fn pages(&self) -> &[Page]
pub fn page(&self, i: usize) -> Result<&Page, Error>
Sourcepub fn contents(&self, i: usize) -> Result<Vec<u8>, Error>
pub fn contents(&self, i: usize) -> Result<Vec<u8>, Error>
the content of a page: its content streams decoded and joined (a stream that cannot be decoded adds nothing)
Sourcepub fn info(&self) -> Info
pub fn info(&self) -> Info
the document information (the Info dictionary; dates as the file writes them)