pub struct DocumentBuilder { /* private fields */ }Expand description
Builder for creating PDF document structures
Implementations§
Source§impl DocumentBuilder
impl DocumentBuilder
pub fn new() -> Self
Sourcepub fn with_catalog(&mut self) -> &mut Self
pub fn with_catalog(&mut self) -> &mut Self
Create document catalog
Sourcepub fn with_pages_tree(&mut self) -> &mut Self
pub fn with_pages_tree(&mut self) -> &mut Self
Create pages tree
Sourcepub fn add_content_stream(&mut self, content: &str) -> &mut Self
pub fn add_content_stream(&mut self, content: &str) -> &mut Self
Add content stream to current page
Sourcepub fn add_font(
&mut self,
name: &str,
font_type: FontType,
base_font: &str,
) -> &mut Self
pub fn add_font( &mut self, name: &str, font_type: FontType, base_font: &str, ) -> &mut Self
Add font to current page resources
Sourcepub fn with_info(
&mut self,
title: Option<&str>,
author: Option<&str>,
creator: Option<&str>,
) -> &mut Self
pub fn with_info( &mut self, title: Option<&str>, author: Option<&str>, creator: Option<&str>, ) -> &mut Self
Add document info
Sourcepub fn add_annotation(
&mut self,
annotation_type: AnnotationType,
rect: [f32; 4],
) -> &mut Self
pub fn add_annotation( &mut self, annotation_type: AnnotationType, rect: [f32; 4], ) -> &mut Self
Add annotation to current page
Sourcepub fn build(self) -> PdfAstGraph
pub fn build(self) -> PdfAstGraph
Build the final document
Sourcepub fn graph(&self) -> &PdfAstGraph
pub fn graph(&self) -> &PdfAstGraph
Get the current graph reference
Sourcepub fn graph_mut(&mut self) -> &mut PdfAstGraph
pub fn graph_mut(&mut self) -> &mut PdfAstGraph
Get mutable graph reference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocumentBuilder
impl RefUnwindSafe for DocumentBuilder
impl Send for DocumentBuilder
impl Sync for DocumentBuilder
impl Unpin for DocumentBuilder
impl UnwindSafe for DocumentBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more