pdf_create/
lib.rs

1#![warn(missing_docs)]
2//! # pdf-create
3//!
4//! Library to create a PDF file with a rustic API
5//!
6//! ```
7//! use chrono::Local;
8//! use pdf_create::{
9//!     common::Point,
10//!     common::{PdfString, Rectangle},
11//!     high::{Handle, Page, Resources},
12//! };
13//!
14//! // Create a new handle
15//! let mut doc = Handle::new();
16//!
17//! // Set some metadata
18//! doc.info.author = Some(PdfString::new("Xiphoseer"));
19//! doc.info.creator = Some(PdfString::new("SIGNUM (c) 1986-93 F. Schmerbeck"));
20//! doc.info.producer = Some(PdfString::new("Signum! Document Toolbox"));
21//! doc.info.title = Some(PdfString::new("EMPTY.SDO"));
22//! doc.info.mod_date = Some(Local::now());
23//! doc.info.creation_date = Some(Local::now());
24//!
25//! // Create a page
26//! let page = Page {
27//!     media_box: Rectangle {
28//!         ll: Point { x: 0, y: 0 },
29//!         ur: Point { x: 592, y: 842 },
30//!     },
31//!     resources: Resources::default(),
32//!     contents: Vec::new(),
33//! };
34//!
35//! // Add the page to the document
36//! doc.pages.push(page);
37//!
38//! // Write the PDF to the console
39//! let stdout = std::io::stdout();
40//! let mut stdolock = stdout.lock();
41//! doc.write(&mut stdolock).expect("Write to stdout");
42//! ```
43
44pub mod common;
45pub mod encoding;
46pub mod high;
47pub mod low;
48pub mod lowering;
49pub mod util;
50pub mod write;
51
52#[doc(hidded)]
53pub extern crate chrono;