pub struct DocumentBuilder { /* private fields */ }Expand description
Builds a new PDF 2.0 file.
Obtained from Document::new or DocumentBuilder::new; the catalog
(object 1) and the page tree root (object 2) exist from the start.
Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
Sourcepub fn add_object(&mut self, object: Object) -> u32
pub fn add_object(&mut self, object: Object) -> u32
Add an object and return the number it was assigned.
Sourcepub fn add_page(&mut self, media_box: Rect, content: impl Into<Vec<u8>>) -> u32
pub fn add_page(&mut self, media_box: Rect, content: impl Into<Vec<u8>>) -> u32
Append a page with content as its content stream.
Every page gets /Resources << /Font << /F1 … >> >> pointing at one
shared Helvetica font, so written content streams that use /F1 are
immediately extractable.
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages appended so far.
Sourcepub fn set_metadata(&mut self, xmp: impl Into<Vec<u8>>)
pub fn set_metadata(&mut self, xmp: impl Into<Vec<u8>>)
Replace the XMP metadata packet written into the catalog.
Trait Implementations§
Source§impl Clone for DocumentBuilder
impl Clone for DocumentBuilder
Source§impl Debug for DocumentBuilder
impl Debug for DocumentBuilder
Auto Trait Implementations§
impl Forget for DocumentBuilder
impl Freeze for DocumentBuilder
impl Move for DocumentBuilder
impl RefUnwindSafe for DocumentBuilder
impl Send for DocumentBuilder
impl Sync for DocumentBuilder
impl Unpin for DocumentBuilder
impl UnsafeUnpin for DocumentBuilder
impl UnwindSafe for DocumentBuilder
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