[−][src]Struct genpdf::render::Renderer
Renders a PDF document with one or more pages.
This is a wrapper around a printpdf::PdfDocumentReference
.
Implementations
impl Renderer
[src]
pub fn new(
size: impl Into<Size>,
title: impl AsRef<str>
) -> Result<Renderer, Error>
[src]
size: impl Into<Size>,
title: impl AsRef<str>
) -> Result<Renderer, Error>
Creates a new PDF document renderer with one page of the given size and the given title.
pub fn with_conformance(self, conformance: PdfConformance) -> Self
[src]
Sets the PDF conformance for the generated PDF document.
pub fn add_page(&mut self, size: impl Into<Size>)
[src]
Adds a new page with the given size to the document.
pub fn page_count(&self) -> usize
[src]
Returns the number of pages in this document.
pub fn get_page(&self, idx: usize) -> Option<&Page>
[src]
Returns a page of this document.
pub fn get_page_mut(&mut self, idx: usize) -> Option<&mut Page>
[src]
Returns a mutable reference to a page of this document.
pub fn first_page(&self) -> &Page
[src]
Returns a mutable reference to the first page of this document.
pub fn first_page_mut(&mut self) -> &mut Page
[src]
Returns the first page of this document.
pub fn last_page(&self) -> &Page
[src]
Returns the last page of this document.
pub fn last_page_mut(&mut self) -> &mut Page
[src]
Returns a mutable reference to the last page of this document.
pub fn load_font(
&self,
path: impl AsRef<Path>
) -> Result<IndirectFontRef, Error>
[src]
&self,
path: impl AsRef<Path>
) -> Result<IndirectFontRef, Error>
Loads the font at the given path, adds it to the generated document and returns a reference to it.
pub fn write(self, w: impl Write) -> Result<(), Error>
[src]
Writes this PDF document to a writer.
Auto Trait Implementations
impl !RefUnwindSafe for Renderer
impl !Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl !UnwindSafe for Renderer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,