[−][src]Struct printpdf::types::pdf_document::PdfDocumentReference
Marker struct for a document. Used to make the API a bit nicer.
It simply calls PdfDocument
functions.
Implementations
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_creation_date(self, creation_date: OffsetDateTime) -> Self
[src]
Sets the creation date on the document.
Per default, the creation date is set to the current time.
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]
&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_bookmark<S>(&self, name: S, page: PdfPageIndex) where
S: Into<String>,
[src]
S: Into<String>,
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,
[src]
&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,
[src]
&self,
bytes: Vec<u8>,
data: F
) -> Result<IndirectFontRef, Error> where
F: FontData + 'static,
Add a font from a custom font backend
pub fn add_builtin_font(
&self,
builtin_font: BuiltinFont
) -> Result<IndirectFontRef, Error>
[src]
&self,
builtin_font: BuiltinFont
) -> Result<IndirectFontRef, Error>
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.
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
impl !RefUnwindSafe for PdfDocumentReference
[src]
impl !Send for PdfDocumentReference
[src]
impl !Sync for PdfDocumentReference
[src]
impl Unpin for PdfDocumentReference
[src]
impl !UnwindSafe for PdfDocumentReference
[src]
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,
pub 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.
pub 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>,