new_document

Function new_document 

Source
pub fn new_document<'a>(
    writer: &'a mut impl Write,
    metadata: Option<&'a Metadata<'a>>,
) -> Document<'a>
Expand description

Create a PDF-backed document, writing the results into a writer.

PDF pages are sized in point units. 1 pt == 1/72 inch == 127/360 mm.

  • writer - A PDF document will be written to this writer. The document may write to the writer at anytime during its lifetime, until either crate::Document::close is called or the document is deleted.
  • metadata - a PDF metadata object. Some fields may be left empty.

Returns None if there is an error, otherwise a newly created PDF-backed Document.