pub struct Document { /* private fields */ }Expand description
A PDF document that can contain multiple pages and metadata.
§Example
use oxidize_pdf::{Document, Page};
let mut doc = Document::new();
doc.set_title("My Document");
doc.set_author("John Doe");
let page = Page::a4();
doc.add_page(page);
doc.save("output.pdf").unwrap();Implementations§
Source§impl Document
impl Document
Sets the document author.
Sourcepub fn set_subject(&mut self, subject: impl Into<String>)
pub fn set_subject(&mut self, subject: impl Into<String>)
Sets the document subject.
Sourcepub fn set_keywords(&mut self, keywords: impl Into<String>)
pub fn set_keywords(&mut self, keywords: impl Into<String>)
Sets the document keywords.
Sourcepub fn set_creator(&mut self, creator: impl Into<String>)
pub fn set_creator(&mut self, creator: impl Into<String>)
Sets the document creator (software that created the original document).
Sourcepub fn set_producer(&mut self, producer: impl Into<String>)
pub fn set_producer(&mut self, producer: impl Into<String>)
Sets the document producer (software that produced the PDF).
Sourcepub fn set_creation_date(&mut self, date: DateTime<Utc>)
pub fn set_creation_date(&mut self, date: DateTime<Utc>)
Sets the document creation date.
Sourcepub fn set_creation_date_local(&mut self, date: DateTime<Local>)
pub fn set_creation_date_local(&mut self, date: DateTime<Local>)
Sets the document creation date using local time.
Sourcepub fn set_modification_date(&mut self, date: DateTime<Utc>)
pub fn set_modification_date(&mut self, date: DateTime<Utc>)
Sets the document modification date.
Sourcepub fn set_modification_date_local(&mut self, date: DateTime<Local>)
pub fn set_modification_date_local(&mut self, date: DateTime<Local>)
Sets the document modification date using local time.
Sourcepub fn update_modification_date(&mut self)
pub fn update_modification_date(&mut self)
Sets the modification date to the current time.
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Gets the number of pages in the document.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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