Overview
graphitepdf-kit provides low-level but ergonomic PDF generation capabilities for Rust. It is designed for systems-level use and integration with the GraphitePDF layout engine.
Scope
graphitepdf-kit contains:
- PDF document building with
DocumentBuilderandPage - Vector graphics (shapes, paths, colors) with
Canvas - Text rendering with standard fonts via
TextBuilder - Page sizing (A series, Letter, custom) with
PageSize - Metadata support with
Metadata - Compressed content streams via
flate2
Installation
API Summary
| Category | Items |
|---|---|
| Document | DocumentBuilder, Page |
| Pages & Layout | PageSize, PageMargins |
| Text | TextBuilder, TextAlignment |
| Vector Graphics | Canvas, Color, GraphicsState |
| Metadata | Metadata |
Example
use ;
Design Principles
- Native Rust implementation with zero PDF library dependencies
- Explicit APIs over implicit magic
- Zero-cost abstractions where possible
- Minimal and focused dependencies
- Clear integration points for GraphitePDF layout engine
Role In GraphitePDF
graphitepdf-kit is the core PDF generation crate used by the main GraphitePDF library to convert laid-out content into final PDF files. It can also be used standalone for basic PDF generation tasks.
License
MIT