stet_pdf/lib.rs
1// stet - A PostScript Interpreter
2// Copyright (c) 2026 Scott Bowman
3// SPDX-License-Identifier: Apache-2.0 OR MIT
4
5//! PDF output device for stet — converts display lists into
6//! print-production-quality PDF files.
7//!
8//! [`PdfDevice`] is an [`OutputDevice`](stet_core::device::OutputDevice)
9//! implementation that walks a display list and emits the corresponding
10//! PDF constructs. It preserves the full fidelity of the source, including
11//! native CMYK and spot colours (without a lossy RGB round-trip),
12//! transfer functions, halftone screens, black-generation / undercolour
13//! removal, overprint settings, rendering intent, and trim boxes.
14//!
15//! Fonts are subsetted to the glyphs actually used on the page, with
16//! per-font ToUnicode CMaps for text extraction and search.
17//!
18//! All seven PostScript shading types are translated to native PDF
19//! shading objects (axial, radial, Gouraud mesh, Coons/tensor patch).
20//!
21//! Most users should use
22//! [`stet::Interpreter::render_to_pdf`](https://docs.rs/stet) from the
23//! [`stet`](https://crates.io/crates/stet) facade crate. Use
24//! [`PdfDevice`] directly when you want to wire the PDF writer into a
25//! custom rendering pipeline or capture the PDF bytes in-memory without
26//! touching the filesystem.
27
28mod annotations;
29mod attachments;
30mod content_stream;
31mod font_embedder;
32mod font_tracker;
33mod form_fields;
34mod image_ops;
35mod metadata;
36mod names;
37mod outline;
38mod pdf_device;
39mod pdf_objects;
40mod pdf_writer;
41mod shading_ops;
42mod text_ops;
43mod unicode_mapping;
44
45pub use pdf_device::PdfDevice;