[−][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.
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: 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_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_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
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
impl !Send for PdfDocumentReference
impl !Sync for PdfDocumentReference
impl Unpin for PdfDocumentReference
impl !UnwindSafe for PdfDocumentReference
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,
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> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
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.
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>,