fulgur-cli-0.1.1 is not a library.
Fulgur
An HTML/CSS to PDF converter written in Rust.
Integrates Blitz (HTML parsing, CSS style resolution, layout) with Krilla (PDF generation) through a pagination-aware layout abstraction.
Features
- HTML/CSS to PDF conversion
- Automatic page splitting with CSS pagination control (
break-before,break-after,break-inside, orphans/widows) - Text shaping via Parley
- Background colors, borders, and padding
- Image embedding (PNG / JPEG / GIF)
- Custom font bundling
- External CSS file injection
- Page sizes (A4 / Letter / A3) with landscape support
- PDF metadata (title, author)
Installation
CLI Usage
# Convert from file
# Read from stdin
|
# With options
# Custom fonts and CSS
Options
| Option | Description | Default |
|---|---|---|
-o, --output |
Output PDF file path (required) | — |
-s, --size |
Page size (A4, Letter, A3) | A4 |
-l, --landscape |
Landscape orientation | false |
--title |
PDF title metadata | — |
-f, --font |
Bundle font files (repeatable) | — |
--css |
External CSS files (repeatable) | — |
--stdin |
Read HTML from stdin | false |
Library Usage
use ;
// Convert with default settings
let pdf = convert_html?;
// Custom configuration
let engine = builder
.page_size
.margin
.title
.build;
let pdf = engine.render_html?;
engine.render_html_to_file?;
Architecture
HTML/CSS input
↓
Blitz (HTML parse → DOM → style resolution → Taffy layout)
↓
DOM → Pageable conversion (BlockPageable / ParagraphPageable / ImagePageable)
↓
Pagination (split Pageable tree at page boundaries)
↓
Krilla rendering (Pageable.draw() per page → PDF Surface)
↓
PDF bytes
Project Structure
crates/
├── fulgur-core/ # Core library (conversion, layout, rendering)
└── fulgur-cli/ # CLI tool
Development
# Build
# Test
# Run CLI directly