pdfboss_write/lib.rs
1//! PDF creation for pdfboss: the write-side twin of `pdfboss-core`.
2//!
3//! Three altitudes, each complete on its own and lowering into the one
4//! beneath:
5//!
6//! - **document** — [`Pdf`] and [`Page`]: plain structs whose fields are
7//! the composition, saved with [`Pdf::save`].
8//! - **canvas** — [`Canvas`]: an imperative painter accumulating
9//! `pdfboss_core::content::Op`, the same IR the reader parses, so every
10//! generated content stream round-trips through `parse_content`.
11//! - **cos** — [`Writer`]: numbered objects in, finished file bytes out,
12//! with stream compression, object streams, both cross-reference styles
13//! and a deterministic `/ID`.
14//!
15//! Determinism is a feature: the same input produces byte-identical
16//! output. The crate never reads clocks or randomness — dates appear only
17//! when callers supply them.
18
19pub mod canvas;
20pub mod color;
21pub mod content;
22pub mod element;
23pub mod error;
24pub mod font;
25pub mod image;
26pub mod pdf;
27pub mod ser;
28pub mod sink;
29pub mod update;
30pub mod writer;
31mod xmp;
32
33pub use canvas::{BlendMode, Canvas, CanvasParts, GroupHandle, ImageHandle, LineCap, LineJoin};
34pub use color::Color;
35pub use content::serialize_ops;
36pub use element::{Content, Draw, Image, Link, Paragraph, ParagraphAlign, Text};
37pub use error::{Error, Result};
38pub use font::Standard14;
39pub use image::ImageData;
40pub use pdf::{
41 Attachment, Bookmark, Date, LabelStyle, LinkAnnotation, LinkTarget, Metadata, Outline, Page,
42 PageLabel, PageLayout, PageMode, PageSize, Pdf, Viewer,
43};
44pub use sink::{AsyncByteSink, Immediate};
45pub use update::{watermark, watermark_with};
46pub use writer::{WriteOptions, Writer, XrefStyle};