Struct printpdf::types::pdf_document::PdfDocumentReference
[−]
[src]
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]
S: Into<String>,
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: DateTime<Local>) -> 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]
&self,
x_mm: Mm,
y_mm: Mm,
inital_layer_name: S
) -> (PdfPageIndex, PdfLayerIndex) where
S: Into<String>,
Create a new pdf page and returns the index of the page
pub fn add_external_font<R>(
&self,
font_stream: R
) -> Result<IndirectFontRef, PrintpdfError> where
R: Read,
[src]
&self,
font_stream: R
) -> Result<IndirectFontRef, PrintpdfError> where
R: Read,
Add a font from a font stream
pub fn add_builtin_font(
&self,
builtin_font: BuiltinFont
) -> Result<IndirectFontRef, PrintpdfError>
[src]
&self,
builtin_font: BuiltinFont
) -> Result<IndirectFontRef, PrintpdfError>
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<(), PrintpdfError>
[src]
Checks for invalid settings in the document
pub fn repair_errors(
&self,
conformance: PdfConformance
) -> Result<(), PrintpdfError>
[src]
&self,
conformance: PdfConformance
) -> Result<(), PrintpdfError>
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<(), PrintpdfError>
[src]
self,
target: &mut BufWriter<W>
) -> Result<(), PrintpdfError>
Save PDF Document, writing the contents to the target