[][src]Struct genpdf::render::Renderer

pub struct Renderer { /* fields omitted */ }

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.