Struct printpdf::types::pdf_document::PdfDocumentReference [−][src]
pub struct PdfDocumentReference { /* fields omitted */ }
Expand description
Marker struct for a document. Used to make the API a bit nicer.
It simply calls PdfDocument
functions.
Implementations
Changes the title on both the document info dictionary as well as the metadata
Set the trapping of the document
Sets the document ID (for comparing two PDF documents for equality)
Set the version of the document
Changes the conformance of this document. It is recommended to call
check_for_errors()
after changing it.
Sets the creation date on the document.
Per default, the creation date is set to the current time.
Sets the metadata date on the document.
By default, the metadata date is set to the current time.
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>,
pub fn add_page<S>(
&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
Create a new pdf page and returns the index of the page. If the page already has a bookmark, overwrites it.
pub fn add_external_font<R>(
&self,
font_stream: R
) -> Result<IndirectFontRef, Error> where
R: Read,
pub fn add_external_font<R>(
&self,
font_stream: R
) -> Result<IndirectFontRef, Error> where
R: Read,
Add a font from a font stream
pub fn add_external_font_data<F>(
&self,
bytes: Vec<u8>,
data: F
) -> Result<IndirectFontRef, Error> where
F: FontData + 'static,
pub fn add_external_font_data<F>(
&self,
bytes: Vec<u8>,
data: F
) -> Result<IndirectFontRef, Error> where
F: FontData + 'static,
Add a font from a custom font backend
Add a built-in font to the document
Built-in fonts can only be used to print characters that are supported by the Windows-1252 encoding. All other characters will be ignored.
Returns the page (for inserting content)
Returns a direct reference (object ID) to the font from an indirect reference (postscript name)
Drops the PDFDocument, returning the inner lopdf::Document
.
Document may be only half-written, use only in extreme cases
Checks for invalid settings in the document
Tries to match the document to the given conformance. Errors only on an unrecoverable error.