Expand description
§Forme
A page-native PDF rendering engine.
Most PDF renderers treat a document as an infinite vertical canvas and then slice it into pages after layout. This produces broken tables, orphaned headers, collapsed flex layouts on page boundaries, and years of GitHub issues begging for fixes.
Forme does the opposite: the page is the fundamental unit of layout. Every layout decision—every flex calculation, every line break, every table row placement—is made with the page boundary as a hard constraint. Content doesn’t get “sliced” after the fact. It flows into pages.
§Architecture
Input (JSON/API)
↓
[model] — Document tree: nodes, styles, content
↓
[style] — Resolve cascade, inheritance, defaults
↓
[layout] — Page-aware layout engine
↓
[pdf] — Serialize to PDF bytesRe-exports§
pub use error::FormeError;pub use layout::LayoutInfo;pub use model::CertificationConfig;pub use model::ColumnDef;pub use model::ColumnWidth;pub use model::FontEntry;pub use model::PatternType;pub use model::RedactionPattern;pub use model::RedactionRegion;pub use model::TextRun;pub use model::ChartDataPoint;pub use model::ChartSeries;pub use model::DotPlotGroup;pub use model::Document;pub use model::Metadata;pub use model::Node;pub use model::NodeKind;pub use model::PageConfig;pub use model::PageSize;pub use style::Style;
Modules§
- barcode
- 1D Barcode Generation
- chart
- Chart Rendering
- error
- Structured error types for the Forme rendering engine.
- font
- Font Management
- image_
loader - Image Loading and Decoding
- layout
- Page-Aware Layout Engine
- model
- Document Model
- PDF Serializer
- qrcode
- QR Code Generation
- style
- Style System
- svg
- SVG Parser
- template
- Template expression evaluator.
- text
- Text Layout
Functions§
- certify_
pdf - Certify PDF bytes with an X.509 certificate.
- find_
text_ regions - Find text regions matching patterns in a PDF.
- merge_
pdfs - Merge multiple PDFs into a single document.
- redact_
pdf - Redact regions of a PDF by overlaying opaque rectangles.
- redact_
text - Redact text matching patterns from a PDF.
- render
- Render a document to PDF bytes.
- render_
json - Render a document described as JSON to PDF bytes.
- render_
json_ with_ layout - Render a document described as JSON to PDF bytes along with layout metadata.
- render_
template - Render a template with data to PDF bytes.
- render_
template_ with_ layout - Render a template with data to PDF bytes along with layout metadata.
- render_
with_ layout - Render a document to PDF bytes along with layout metadata.