Struct pdf_canvas::Pdf [] [src]

pub struct Pdf { /* fields omitted */ }

The top-level object for writing a PDF.

A PDF file is created with the create or new methods. Some metadata can be stored with set_foo methods, and pages are appended with the render_page method. Don't forget to call finish when done, to write the document trailer, without it the written file won't be a proper PDF.

Methods

impl Pdf
[src]

Create a new PDF document as a new file with given filename.

Create a new PDF document, writing to output.

Set metadata: the document's title.

Set metadata: the name of the person who created the document.

Set metadata: the subject of the document.

Set metadata: keywords associated with the document.

Set metadata: If the document was converted to PDF from another format, the name of the conforming product that created the original document from which it was converted.

Set metadata: If the document was converted to PDF from another format, the name of the conforming product that converted it to PDF.

Create a new page in the PDF document.

The page will be width x height points large, and the actual content of the page will be created by the function render_contents by applying drawing methods on the Canvas.

Write out the document trailer. The trailer consists of the pages object, the root object, the xref list, the trailer object and the startxref position.