pub struct PdfDocument { /* private fields */ }
Available on crate features
format-pdf
and format
only.Expand description
PDF document.
Implementations§
Source§impl PdfDocument
impl PdfDocument
Sourcepub fn try_new(
document_title: impl Into<String>,
page_size: Option<(f32, f32)>,
) -> Result<Self, Error>
pub fn try_new( document_title: impl Into<String>, page_size: Option<(f32, f32)>, ) -> Result<Self, Error>
Attempts to create a new document with the default settings.
Sourcepub fn set_page_size(&mut self, page_width: f32, page_height: f32)
pub fn set_page_size(&mut self, page_width: f32, page_height: f32)
Sets the page size.
Sourcepub fn set_margin(
&mut self,
margin_left: f32,
margin_right: f32,
margin_top: f32,
margin_bottom: f32,
)
pub fn set_margin( &mut self, margin_left: f32, margin_right: f32, margin_top: f32, margin_bottom: f32, )
Sets the page margin.
Sourcepub fn set_font_size(&mut self, font_size: f32)
pub fn set_font_size(&mut self, font_size: f32)
Sets the font size.
Sourcepub fn add_new_page(&mut self)
pub fn add_new_page(&mut self)
Adds a new page to the document.
Sourcepub fn add_new_layer(&mut self)
pub fn add_new_layer(&mut self)
Adds a new layer to the current page.
Sourcepub fn add_text(&mut self, text: impl ToString, position: (f32, f32))
pub fn add_text(&mut self, text: impl ToString, position: (f32, f32))
Adds text to the current layer at the position (x, y)
.
The origin is at the top-left cornner.
Auto Trait Implementations§
impl Freeze for PdfDocument
impl !RefUnwindSafe for PdfDocument
impl !Send for PdfDocument
impl !Sync for PdfDocument
impl Unpin for PdfDocument
impl !UnwindSafe for PdfDocument
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