pdf-writer
A step-by-step PDF writer.
The entry point into the API is the main PdfWriter
. The document is written
into an internal buffer, but otherwise the API is largely non-allocating.
Minimal example
The following example creates a PDF with a single, empty A4 page.
use ;
// Start writing with the PDF version 1.7 header.
let mut writer = new;
// The document catalog and a page tree with one A4 page that uses no resources.
writer.catalog.pages;
writer.pages.kids;
writer.page
.parent
.media_box
.resources;
// Finish with cross-reference table and trailer and write to file.
write?;
For a more comprehensive overview, check out the hello world example in the repository, which creates a document with text in it.
License
This crate is dual-licensed under the MIT and Apache 2.0 licenses.