[][src]Struct printpdf::types::pdf_document::PdfDocumentReference

pub struct PdfDocumentReference { /* fields omitted */ }

Marker struct for a document. Used to make the API a bit nicer. It simply calls PdfDocument functions.

Methods

impl PdfDocumentReference[src]

pub fn with_title<S>(self, new_title: S) where
    S: Into<String>, 
[src]

Changes the title on both the document info dictionary as well as the metadata

pub fn with_trapping(self, trapping: bool) -> Self[src]

Set the trapping of the document

pub fn with_document_id(self, id: String) -> Self[src]

Sets the document ID (for comparing two PDF documents for equality)

pub fn with_document_version(self, version: u32) -> Self[src]

Set the version of the document

pub fn with_conformance(self, conformance: PdfConformance) -> Self[src]

Changes the conformance of this document. It is recommended to call check_for_errors() after changing it.

pub fn with_mod_date(self, mod_date: OffsetDateTime) -> Self[src]

Sets the modification date on the document. Intended to be used when reading documents that already have a modification date.

pub fn add_page<S>(
    &self,
    x_mm: Mm,
    y_mm: Mm,
    inital_layer_name: S
) -> (PdfPageIndex, PdfLayerIndex) where
    S: Into<String>, 
[src]

Create a new pdf page and returns the index of the page

pub fn add_external_font<R>(
    &self,
    font_stream: R
) -> Result<IndirectFontRef, Error> where
    R: Read
[src]

Add a font from a font stream

pub fn add_builtin_font(
    &self,
    builtin_font: BuiltinFont
) -> Result<IndirectFontRef, Error>
[src]

Add a built-in font to the document

pub fn get_page(&self, page: PdfPageIndex) -> PdfPageReference[src]

Returns the page (for inserting content)

pub fn get_font(&self, font: &IndirectFontRef) -> Option<DirectFontRef>[src]

Returns a direct reference (object ID) to the font from an indirect reference (postscript name)

pub unsafe fn get_inner(self) -> Document[src]

Drops the PDFDocument, returning the inner lopdf::Document. Document may be only half-written, use only in extreme cases

pub fn check_for_errors(&self) -> Result<(), Error>[src]

Checks for invalid settings in the document

pub fn repair_errors(&self, _conformance: PdfConformance) -> Result<(), Error>[src]

Tries to match the document to the given conformance. Errors only on an unrecoverable error.

pub fn save<W: Write>(self, target: &mut BufWriter<W>) -> Result<(), Error>[src]

Save PDF Document, writing the contents to the target

Auto Trait Implementations

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> SetParameter for T

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.