Fullbleed
Deterministic, self-contained HTML/CSS-to-PDF generation in Rust, with a Python-first CLI and Python engine bindings.
License: MIT.
- Install:
pip install fullbleed - Try:
fullbleed init . && python report.py - Outputs:
output/report.pdf - Deterministic + reproducible (
--repro-record/--repro-check) - Agent-safe JSON schemas (
--json-only,--schema)
Positioning
Fullbleed is a deterministic, offline-first document rendering engine for transactional/VDP pipelines (not a browser, not a hosted web-to-print SaaS).
HTML and CSS are used as a familiar DSL for layout, styling, and data placement in transactional documents.
This README is the canonical usage guide for:
fullbleedCLI (human workflows + machine/agent automation)fullbleedPython bindings (PdfEngine,AssetBundle, batch APIs)
Additional focused references are in docs/:
docs/install-non-technical.md(step-by-step setup for non-technical users)docs/css-coverage.md(validated CSS coverage, parity status, and active gaps)docs/README.mddocs/engine.mddocs/python-api.mddocs/ui-accessibility.mddocs/cli.mddocs/pdf-templates.md
What You Get
- No headless browser requirement for PDF generation.
- Deterministic render pipeline with optional SHA256 output hashing.
- Reproducibility workflow via
--repro-recordand--repro-check. - PDF
1.7as the production-stable default target. - Rust-native PDF template composition for VDP/transactional overlays.
- Native Rust image emission for overlay and finalized compose outputs (
--emit-image) without external PDF raster runtime dependencies. - Feature-driven page-to-template binding with per-page deterministic compose plans.
- Structured JSON result schemas for CI and AI agents.
- Offline-first asset model with explicit remote opt-in.
- Remote project template registry workflows (
new list,new search,new remote). - Python-first extension surface for hackability and custom workflows.
- Python render calls release the GIL while Rust rendering executes.
- Ordered standard-library worker pools for batch rendering and selected internal workloads.
- No third-party Rust crate graph and no required third-party Python runtime or build packages.
Concurrency Model
- Python binding render methods release the GIL during Rust execution through the Stable ABI bridge.
- Parallel batch APIs use Fullbleed's ordered standard-library worker pool (
render_pdf_batch_parallel(...)and parallel-to-file variants). - The same bounded worker implementation serves selected internal hotspots such as table layout and JIT paint paths.
- Do not assume every single-document render path will fully saturate all cores end-to-end.
Install
New to Python or setting up on a fresh machine? Start with docs/install-non-technical.md.
From a local wheel:
From a source checkout with Rust installed, no Python build package is needed:
To create deterministic release artifacts directly:
Platform artifact policy:
- Linux wheels cover
manylinux2014on x86-64, x86, ARM64, ARMv7, s390x, and ppc64le, plusmusllinux_1_2on x86-64, x86, ARM64, and ARMv7. - Windows wheels cover x86-64, x86, and ARM64; macOS wheels cover Intel and Apple silicon.
- The CPython stable ABI allows each platform wheel to support Python 3.10 through 3.14.
- CI installs and exercises every built wheel on its target architecture, using native runners or QEMU as appropriate. The x86-64 manylinux wheel is additionally tested on every supported Python version before publication.
Verify command surface:
60-Second Quick Start (Project Happy Path)
Initialize project scaffold:
fullbleed init now vendors Bootstrap (5.0.0) into vendor/css/bootstrap.min.css,
vendors Bootstrap Icons (1.11.3) into vendor/icons/bootstrap-icons.svg,
vendors inter into vendor/fonts/Inter-Variable.ttf, writes license notices
(vendor/css/LICENSE.bootstrap.txt, vendor/icons/LICENSE.bootstrap-icons.txt, vendor/fonts/LICENSE.inter.txt),
and seeds assets.lock.json with pinned hashes.
The scaffolded report.py also runs a component mount smoke validation before
main render and writes output/component_mount_validation.json (fails fast on
missing glyphs, placement overflow, or CSS miss signals parsed from debug logs).
Scaffolded components now include components/primitives.py with reusable
layout/content helpers (Stack, Row, Text, table/list helpers, key/value rows, etc.).
Each scaffolded project also includes SCAFFOLDING.md, which should be your
first read before restructuring components.
Install additional project assets (defaults to ./vendor/... in project context):
Bootstrap baseline note:
- We target Bootstrap (
5.0.0) as the default styling baseline for project workflows. - Re-run
fullbleed assets install bootstrap --jsononly if you want to explicitly refresh/bootstrap-manage outsideinit.
Render using the scaffolded component pipeline:
Expected artifacts from scaffolded report.py:
output/report.pdfoutput/report_page1.png(or equivalent page preview from engine image APIs)output/component_mount_validation.jsonoutput/css_layers.json
Canonical static PDF reference:
examples/canonical_reference/ is the exhaustive scaffold-shaped reference for
component composition, layered CSS, bundled fonts/SVG, inline SVG, raster data
URIs, linked and standalone HTML artifacts, PDF output, PNG previews, and
validation reports.
Project Bootstrap Templates (fullbleed new)
Use local starters:
Discover remote starters from registry:
fullbleed new local accessible is the verbose accessibility-first starter and
demonstrates the fullbleed.accessibility runtime surface (engine verifier,
PMR, PDF/UA-targeted seed checks, and non-visual trace artifacts).
fullbleed new local reference vendors the canonical static PDF reference shape
as a scaffolded project with component layers, assets, PDF/PNG outputs, page data,
and validation reports.
Optional registry override (for private/canary registries):
or:
Scaffold-First Workflow (Recommended)
fullbleed init is designed for component-first authoring rather than a single large HTML template.
Typical scaffold layout:
.
|-- SCAFFOLDING.md
|-- COMPLIANCE.md
|-- report.py
|-- components/
| |-- fb_ui.py
| |-- primitives.py
| |-- header.py
| |-- body.py
| |-- footer.py
| `-- styles/
| |-- primitives.css
| |-- header.css
| |-- body.css
| `-- footer.css
|-- styles/
| |-- tokens.css
| `-- report.css
|-- vendor/
| |-- css/
| |-- fonts/
| `-- icons/
`-- output/
Best-practice authoring model:
- Read
SCAFFOLDING.mdfirst for project conventions. - Keep composition and data loading in
report.py. - Keep reusable component building blocks in
components/primitives.py. - Keep section markup in
components/header.py,components/body.py,components/footer.py. - Keep component-local styles in
components/styles/*.css. - Keep page tokens/composition styles in
styles/tokens.cssandstyles/report.css.
Recommended CSS layer order:
styles/tokens.csscomponents/styles/primitives.csscomponents/styles/header.csscomponents/styles/body.csscomponents/styles/footer.cssstyles/report.css
Recommended iteration loop:
- Edit data loading + component props in
report.py. - Edit component markup in
components/*.py. - Edit styles in
components/styles/*.cssandstyles/*.css. - Run
python report.py. - Review
output/report_page1.png,output/component_mount_validation.json, andoutput/css_layers.json.
Optional scaffold diagnostics:
FULLBLEED_DEBUG=1to emit JIT traces.FULLBLEED_PERF=1to emit perf traces.FULLBLEED_EMIT_PAGE_DATA=1to persist page data JSON.FULLBLEED_IMAGE_DPI=144(or higher) for preview resolution.FULLBLEED_VALIDATE_STRICT=1for stricter validation gates in CI.
One-off Quick Render (No Project Scaffold)
Render inline HTML/CSS with reproducibility artifacts:
--deterministic-hash writes the output PDF SHA-256 by default; when --emit-image is enabled, it writes an artifact-set digest (fullbleed.artifact_digest.v1) over PDF SHA-256 plus ordered page-image SHA-256 hashes. JSON outputs expose outputs.deterministic_hash_mode (pdf_only or artifact_set_v1), with outputs.artifact_sha256 and outputs.image_sha256 when images are emitted.
Re-run and enforce reproducibility against a stored record:
Generate PNG page artifacts from an existing validation render:
Compile-only plan (no render):
Template compose planning (no finalize write):
PDF Template Composition (VDP / Transactional)
When overlaying variable data onto a source PDF, use the built-in Rust template compose path.
Minimal CLI auto-compose flow:
Compose image semantics:
- In template auto-compose mode,
--emit-imagePNGs are rasterized from finalized composed pages and reportoutputs.image_mode=composed_pdf. - In non-compose
render/verifyruns,--emit-imagereportsoutputs.image_mode=overlay_document.
Minimal template_binding example:
Python API compose flow:
=
, , =
=
=
See docs/pdf-templates.md and examples/template-flagging-smoke/ for full production examples.
CLI Command Map
| Command | Purpose | JSON Schema |
|---|---|---|
render |
Render HTML/CSS to PDF with optional PNG page artifacts | fullbleed.render_result.v1 |
verify |
Validation render path with optional PDF and PNG emits | fullbleed.verify_result.v1 |
plan |
Compile/normalize inputs into manifest + warnings | fullbleed.plan_result.v1 |
run |
Render using Python module/file engine factory | fullbleed.run_result.v1 |
inspect pdf |
Inspect PDF metadata and composition compatibility | fullbleed.inspect_pdf.v1 |
inspect pdf-batch |
Inspect multiple PDFs with per-file status | fullbleed.inspect_pdf_batch.v1 |
inspect templates |
Inspect template catalog metadata/compatibility | fullbleed.inspect_templates.v1 |
compliance |
License/compliance report for legal/procurement | fullbleed.compliance.v1 |
debug-perf |
Summarize perf JSONL logs | fullbleed.debug_perf.v1 |
debug-jit |
Filter/inspect JIT JSONL logs | fullbleed.debug_jit.v1 |
doctor |
Runtime capability and health checks | fullbleed.doctor.v1 |
capabilities |
Machine-readable command/engine capabilities | fullbleed.capabilities.v1 |
assets list |
Installed and optional remote packages | fullbleed.assets_list.v1 |
assets info |
Package details + hashes/sizes | fullbleed.assets_info.v1 |
assets install |
Install builtin/remote package | fullbleed.assets_install.v1 |
assets verify |
Validate package and optional lock constraints | fullbleed.assets_verify.v1 |
assets lock |
Write/update assets.lock.json |
fullbleed.assets_lock.v1 |
cache dir |
Cache location | fullbleed.cache_dir.v1 |
cache prune |
Remove old cached packages | fullbleed.cache_prune.v1 |
init |
Initialize project scaffold | fullbleed.init.v1 |
new |
Create starter template files or query/install remote templates | fullbleed.new_template.v1, fullbleed.new_list.v1, fullbleed.new_search.v1, fullbleed.new_remote.v1 |
Schema discovery for any command/subcommand:
CLI Flags That Matter Most
Global machine flags:
--json: structured result payload to stdout--json-only: implies--jsonand--no-prompts--schema: emit schema definition and exit--no-prompts: disable interactive prompts--config: load defaults from a config file--log-level error|warn|info|debug: control CLI log verbosity--no-color: disable ANSI color output--version: print CLI version and exit
Render/verify/plan key flags:
- Inputs:
--html,--html-str,--css,--css-str--htmlaccepts.svgfiles for direct SVG-document rendering;--html-straccepts inline SVG markup. - Page setup:
--page-size,--page-width,--page-height,--margin,--page-margins - Engine toggles:
--reuse-xobjects,--svg-form-xobjects,--svg-raster-fallback,--shape-text,--unicode-support,--unicode-metrics - PDF/compliance:
--pdf-version,--pdf-profile,--color-space,--document-lang,--document-titleStable default is--pdf-version 1.7for shipping workflows. Profile targets:none,pdfa1a,pdfa1b,pdfa2a,pdfa2b,pdfa2u,pdfa3a,pdfa3b,pdfa3u,pdfa4,pdfa4e,pdfa4f,pdfx4,pdfua1,pdfua2,pdfvt1,wtpdf1r,wtpdf1a,tagged. Aliases:a,ua,vt,wt1r,wt1a,pdf/a,pdf/ua,pdf/vt. Output intent metadata (--output-intent-identifier|--output-intent-info|--output-intent-components) requires--output-intent-icc. Runpython tools/validate_pdf_profiles.py --download-verapdf --install-pdf-oxide --strict-externalto regenerate profile specimens, capture inspect/JIT evidence, replay deterministic hashes, validate PDF/A and PDF/UA with veraPDF, and validate PDF/X-4 withpdf_oxide. WTPDF profiles are validated with veraPDFwt1r/wt1aand include PDF Declaration evidence.pdfa4femits and checks an associatedEmbeddedFilesname tree.pdfvt1also emits and checks a parsed DPart graph (DPartRoot,DPartRootNode, one-levelNodeNameList, leaf page range, and page/DPartreferences), including a supplemental multipage specimen for/Startand/End, reported as granular booleans pluspdfvt_dpart_graph_valid; use a dedicated PDF/VT preflight tool for third-party PDF/VT certification, or wire one into the same harness with--pdfvt-cmd "tool --input {pdf}" --require-dedicated-pdfvt. - Watermarking:
--watermark-text,--watermark-html,--watermark-image,--watermark-layer,--watermark-semantics,--watermark-opacity,--watermark-rotation - Artifacts:
--emit-jit,--emit-perf,--emit-glyph-report,--emit-page-data,--emit-compose-plan,--emit-image,--image-dpi,--deterministic-hash - Assets:
--asset,--asset-kind,--asset-name,--asset-trusted,--allow-remote-assets - Profiles:
--profile dev|preflight|prod - Fail policy:
--fail-on overflow|missing-glyphs|font-subst|budget - Fallback policy:
--allow-fallbacks(keeps fallback diagnostics, but does not failmissing-glyphs/font-substgates) - Reproducibility:
--repro-record <path>,--repro-check <path> - Budget thresholds:
--budget-max-pages,--budget-max-bytes,--budget-max-ms - Release gates:
doctor --strict,compliance --strict --max-audit-age-days <n>
SVG Workflows
Fullbleed supports SVG in three practical CLI paths:
- Direct SVG document render via
--html <file.svg> - Inline SVG markup via
--html-str "<svg ...>...</svg>" - Referenced SVG assets via
--asset <file.svg>(kind auto-infers tosvg)
Standalone SVG file to PDF:
Inline SVG markup to PDF:
HTML template with explicit SVG asset registration:
SVG render behavior flags:
--svg-form-xobjects/--no-svg-form-xobjects--svg-raster-fallback/--no-svg-raster-fallback
Distributed Python wheels enable the svg_raster engine feature, so
--svg-raster-fallback can rasterize unsupported SVG constructs such as SVG
text, filters, masks, and foreignObject into deterministic image content.
Custom source builds must include --features python,svg_raster to advertise
and use that fallback path.
Machine discovery:
Inspect the svg object in fullbleed.capabilities.v1 for SVG support metadata.
It reports the compiled svg_raster build feature plus a feature matrix for
native-vector SVG, raster-fallback-required SVG, and unsupported/known-loss SVG
features.
Image Support Matrix
Launch-safe image claims:
- Supported direct raster inputs: PNG and JPEG.
- SVG is handled by the SVG pipeline described above, with native-vector output
where supported and raster fallback for fallback-only features when
svg_rasteris enabled. - Supported references include filesystem paths, registered bundle assets,
file/data URIs,
<img>, CSSbackground-image: url(...), list-style images, and watermark images. - Unsupported or not launch-claimed as direct inputs: WebP, GIF, TIFF, AVIF,
BMP, animated images,
<picture>,srcset,sizes, density descriptors, and browser-style responsive image selection. - For deterministic builds, prefer vendored local assets or registered
AssetBundleinputs; remote assets must be explicitly allowed.
Per-Page Templates (page_1, page_2, page_n)
Fullbleed uses ordered page templates internally. In docs, this is easiest to think of as:
page_1: first page templatepage_2: second page templatepage_n: repeating template for later pages
Configuration mapping:
- CLI
--page-marginskeys:1,2, ... and optional"n"(or"each"alias). - Python
PdfEngine(page_margins=...): same key model. - Missing numeric pages fall back to the base
margin. - The last configured template repeats for remaining pages.
Minimal CLI example:
Minimal Python example:
=
Note:
- CLI currently exposes
--header-each/--footer-each(and--header-html-each/--footer-html-each). - For
first/lastheader/footer variants (header_first,header_last,footer_first,footer_last), use the Python API.
Asset Workflow (CLI)
List installed + available packages:
Install builtin assets:
# `@bootstrap` / `@bootstrap-icons` are also supported aliases
PowerShell note:
- Quote
@aliases (for example"@bootstrap") to avoid shell parsing surprises.
Install remote asset package:
Install broad Unicode fallback package (larger font payload):
Install to a custom vendor directory:
Install to global cache:
Install common barcode fonts (license-safe defaults):
Verify against lock file with strict failure:
Preview cache cleanup without deleting files:
Notes:
- Builtin packages accept both plain and
@references (bootstrap==@bootstrap,bootstrap-icons==@bootstrap-icons,noto-sans==@noto-sans). noto-sansis available as a builtin fallback package, but it is intentionally larger thaninter; use it when your document requires broader glyph coverage.- Project installs default to
./vendor/when project markers are present (assets.lock.json,report.py, orfullbleed.tomlin CWD). - If no project markers are found,
assets installdefaults to global cache unless--vendoris explicitly set. - Do not hardcode cache paths like
%LOCALAPPDATA%/fullbleed/cache/...; useassets install --jsonand consumeinstalled_to. - Installed assets include license files in typed vendor directories (for example
vendor/fonts/,vendor/css/). assets lock --addis currently aimed at builtin package additions.- Barcode packages in the remote registry are currently OFL-1.1 families from Google Fonts (
Libre Barcode). - USPS IMB fonts are not currently auto-installable via
assets install; use local vetted font files and track licensing separately.
Bootstrap Vendoring
Bootstrap builtin package details:
- Package:
bootstrap(alias:@bootstrap) - Bundled version:
5.0.0 - Asset kind: CSS (
bootstrap.min.css) - Default install location:
vendor/css/bootstrap.min.css(project mode) - License:
MIT - License source:
https://raw.githubusercontent.com/twbs/bootstrap/v5.0.0/LICENSE
Bootstrap Icons builtin package details:
- Package:
bootstrap-icons(alias:@bootstrap-icons) - Bundled version:
1.11.3 - Asset kind: SVG sprite (
bootstrap-icons.svg) - Default install location:
vendor/icons/bootstrap-icons.svg(project mode) - License:
MIT - License source:
https://raw.githubusercontent.com/twbs/icons/v1.11.3/LICENSE
Bootstrap notes:
- Bootstrap is vendored and installable through the asset pipeline.
- Bootstrap CSS is consumed as an explicit local asset (
--asset @bootstraporAssetBundle); external HTML<link rel="stylesheet">is not an execution path. - Bootstrap preflight examples remain useful smoke examples, but they are not the canonical source of CSS parity claims.
Validated CSS Coverage
For the full, maintained coverage statement, see docs/css-coverage.md.
Summary as of May 19, 2026:
- Tracked CSS modules:
22 - Module state:
22/22 in_progress - Full CSS fixture lane:
86/86fixtures passing with603assertion/paint checks - Parity status check: green (
tools/generate_css_parity_status.py --check --json) - Canonical validation artifact:
_css_working/css_parity_status.json - Canonical validation artifact:
_css_working/tmp/fixture_full_latest.json - Canonical validation artifact:
_css_working/css_broad_coverage_sprint_s14.md
Current validated behavior includes first-class parser -> evaluator -> calculator -> layout/paint coverage across broad static-document CSS domains (values math, layout primitives, pagination/fragmentation baselines, transforms phase-1, gradient/effects subsets including color-first and interleaved-color filter: drop-shadow(...) with computed lengths, modern rgb() shadow colors with mm lengths, duplicate drop-shadow(...) color rejection, empty optional filter-function defaults, explicit/currentColor backdrop-filter: drop-shadow(...) raster paint, strict box-shadow length/color grammar with modern rgb() plus mm paint coverage, softened blurred inset edge paint, and directional inset offset edge paint, overflow-gated text-overflow: ellipsis, physical min/max box constraints, horizontal-tb RTL direction inline inset/margin/padding/border mapping, vertical writing-mode direction: rtl inline inset remapping, vertical-rl logical sizing/insets/margin/padding/border/min-max constraints, vertical-lr logical sizing/min-max/insets/margin/padding/border remapping, basic vertical text columns with vertical-rl leftward and vertical-lr rightward line progression, and deterministic diagnostics).
Known gap categories are explicitly tracked for the final parity push:
- remaining filter/backdrop-filter function breadth beyond current subset, including SVG
url()filters, advanceddrop-shadow()forms beyond the current flexible-color-order foreground and baseline backdrop coverage, and PDF-native foreground filters - advanced
clip-pathgrammar beyond the current basic-shape subset, including SVG clip sources, SVG-specific geometry boxes, and deeper edge grammar - plus-lighter PDF-native parity and deeper nested compositing/isolation breadth
- deeper blurred inset shadow edge fidelity
- remaining multi-layer background image edge semantics beyond the current sized gradient-layer repeat-x/space/round and PNG
url(...)explicit-size/auto-auto-intrinsic/negative-size-invalid/contain/cover/auto-dimension-size/single-value-size/alpha-stack/default-repeat-repeat/repeat-y/repeat/repeat-no-repeat/no-repeat-repeat/space-space/round-round/round-space/space-round/round-repeat/round-no-repeat/no-repeat-round/no-repeat-space/space-no-repeat/repeat-space/repeat-round/space-repeat/logical-repeat-aliases/multi-layer-repeat-axis/background-list-repetition/percentage-position/edge-offset-position/logical-position-aliases/shorthand-position-size-repeat/content-box-origin-clip/multi-layer-origin-clip/background-blend-normal/background-blend-multiply/screen-mode/overlay-mode/exclusion-mode/hard-light-mode/darken-mode/lighten-mode/color-dodge-mode/color-burn-mode/soft-light-mode/hue-mode/saturation-mode/color-mode/luminosity-mode/plus-lighter-mode/list-repetition/truncation/raster-blend/raster-layer-mapping/mixed-raster-gradient-mapping/mixed-gradient-raster-mapping subset, including broader mixed raster stack combinations - table layout edge semantics hardening beyond the current fixed-layout width-hint, auto-width, caption-side placement, and invalid caption-side inheritance lanes
- full vertical text/layout flow beyond the current vertical static-layout and basic wrapped text-column baseline
run Command (Python Factory Interop)
run lets the CLI use a Python-created engine instance.
report.py:
return
CLI invocation:
Entrypoint formats:
module_name:factory_or_enginepath/to/file.py:factory_or_engine
Python API Quick Start
=
=
=
=
Register local assets with AssetBundle:
=
=
Python API Signatures (Runtime-Verified)
These signatures are verified from the installed package via inspect.signature(...).
PdfEngine constructor:
Module exports:
PdfEngineAssetBundleAssetAssetKindWatermarkSpec(kind, value, layer='overlay', semantics=None, opacity=0.15, rotation_deg=0.0, font_name=None, font_size=None, color=None)concat_css(parts)vendored_asset(source, kind, name=None, trusted=False, remote=False)inspect_pdf(path)inspect_template_catalog(templates)finalize_stamp_pdf(template, overlay, out, page_map=None, dx=0.0, dy=0.0)finalize_compose_pdf(templates, plan, overlay, out, annotation_mode='link_only')fetch_asset(url)
PdfEngine methods:
| Method | Return shape |
|---|---|
register_bundle(bundle) |
None |
render_pdf(html, css, deterministic_hash=None) |
bytes |
render_pdf_to_file(html, css, path, deterministic_hash=None) |
int (bytes written) |
render_image_pages(html, css, dpi=150) |
list[bytes] |
render_image_pages_to_dir(html, css, out_dir, dpi=150, stem=None) |
list[str] |
render_finalized_pdf_image_pages(pdf_path, dpi=150) |
list[bytes] |
render_finalized_pdf_image_pages_to_dir(pdf_path, out_dir, dpi=150, stem=None) |
list[str] |
render_pdf_with_glyph_report(html, css) |
(bytes, list) |
render_pdf_with_page_data(html, css) |
(bytes, page_data_or_none) |
render_pdf_with_page_data_and_glyph_report(html, css) |
(bytes, page_data_or_none, glyph_report_list) |
render_pdf_with_page_data_and_template_bindings(html, css) |
(bytes, page_data_or_none, template_bindings_or_none) |
render_pdf_with_page_data_and_template_bindings_and_glyph_report(html, css) |
(bytes, page_data_or_none, template_bindings_or_none, glyph_report_list) |
plan_template_compose(html, css, templates, dx=0.0, dy=0.0) |
dict |
render_pdf_batch(html_list, css, deterministic_hash=None) |
bytes |
render_pdf_batch_parallel(html_list, css, deterministic_hash=None) |
bytes |
render_pdf_batch_to_file(html_list, css, path, deterministic_hash=None) |
int |
render_pdf_batch_to_file_parallel(html_list, css, path, deterministic_hash=None) |
int |
render_pdf_batch_to_file_parallel_with_page_data(html_list, css, path, deterministic_hash=None) |
(bytes_written, page_data_list) |
render_pdf_batch_with_css(jobs, deterministic_hash=None) |
bytes |
render_pdf_batch_with_css_to_file(jobs, path, deterministic_hash=None) |
int |
When deterministic_hash is set, engine writes PDF SHA-256 to the provided file path.
AssetBundle methods:
add_file(path, kind, name=None, trusted=False, remote=False)add(asset)assets_info()css()
Python Examples (Smoke-Checked)
Canonical scaffold reference:
Text watermark + diagnostics:
=
=
=
=
Batch render + glyph/page-data checks:
=
=
=
, =
, =
Transactional Header/Footer + Totals
Minimal, self-contained Python example (no external template files) showing:
- Continued headers on page 2+.
- Per-page subtotal footer expansion via
{sum:items.amount}. - Final-page grand total footer expansion via
{total:items.amount}. - Structured
page_datatotals for automation and reconciliation checks.
=
# enough rows to force multiple pages
= 10.00 + + 0.25
= f
=
=
, =
assert >= 2
assert ==
API note:
- For transactional running totals (
paginated_context) and HTML header/footer placement (header_html_*,footer_html_*), use the PythonPdfEngineAPI path. - The CLI currently exposes direct text header/footer flags (
--header-each,--footer-each) for simpler cases.
CLI watermark parity example:
Reference-Image Parity Workflow (Practical)
When targeting a design reference image (for example reference image exports), this loop has worked well:
- Start from
fullbleed initso CSS/font/icon baselines are vendored and pinned. - For scaffolded projects, run
python report.pyand setFULLBLEED_IMAGE_DPIas needed for sharper previews. - For direct CLI template rendering, register assets through the CLI (
--asset ...) orAssetBundle. - Iterate with image artifacts enabled:
- Use
--repro-record/--repro-checkonce your layout stabilizes.
Practical tips:
- Compare against full-page exports when available.
- Keep a fixed preview DPI (for example
144or200) across iterations. - Commit PNG baselines for repeatable visual checks.
Public Golden Regression Suite
Launch-grade render regression coverage is available under goldens/ with three fixtures:
invoicestatementmenu
Golden contract assets:
- Expected hashes:
goldens/expected/golden_suite.expected.json - Expected PNG baselines:
goldens/expected/png/<case>/<case>_page1.png
Run against committed expectations:
Refresh baselines intentionally:
Human + AI Operating Mode
Recommended automation defaults:
Why this is agent-safe:
- For command-execution JSON payloads,
schemais always present. - Parser usage errors (
exit=2) are emitted by argparse as usage text, not JSON payloads. okindicates success/failure without parsing text.- Optional artifacts are explicitly named in
outputs. - Schema introspection is available at runtime (
--schema).
Example parse loop:
=
=
assert ==
assert is True
MACHINE_CONTRACT.v1
Important Behavior Notes
render --jsoncannot be combined with--out -(stdout PDF bytes).verifydefaults to stdout PDF unless--emit-pdfis provided; for machine mode, use--emit-pdf <path>.--emit-image <dir>writes per-page PNGs as<stem>_pageN.png(stem comes from--out/--emit-pdf, orrenderwhen streaming PDF to stdout).- In template auto-compose runs,
--emit-imageartifacts are rasterized from finalized composed pages and reportoutputs.image_mode=composed_pdf; otherwiseimage_mode=overlay_document. outputs.deterministic_hash_modeispdf_onlyby default andartifact_set_v1when image artifacts are emitted.- If both
--emit-page-dataand--emit-glyph-reportare set, current engines use a combined API and render once; older engines without that API fall back to a double render. - Production target is PDF
1.7. runaccepts--html-strwithout requiring--html.initnow scaffoldsCOMPLIANCE.mdfor project-level release review.compliance --jsonemits machine-readable legal/procurement diagnostics.--watermark-layer underlayis accepted as a legacy alias and normalized tobackground.--emit-manifestincludes awatermarkobject withtext|html|image|layer|semantics|opacity|rotation|enabled.--fail-on overflowis enforced from placement data and may auto-enable internal JIT planning.--fail-on font-substis enforced using missing glyph and fallback diagnostics.--allow-fallbacksallows fallback diagnostics to remain informational formissing-glyphs/font-substgates while still reporting them in JSON output.--fail-on budgetrequires at least one budget threshold flag.--repro-checkfails on input/hash drift and lock hash mismatches when lock data is available.- PDF/A and PDF/X/VT profiles require output intent metadata;
pdfa4,pdfa4e, andpdfa4femit PDF 2.0 automatically. PDF/A, PDF/X/VT, PDF/UA, and WTPDF text output enforces embedded-font constraints, and CLI errors include an actionable hint to add an embeddable font asset. --pdf-profile pdfua1enables tagged output and PDF/UA-1 identification metadata. Treat verifier/seed traces as machine evidence before making external conformance claims.argparseusage errors exit with code2and emit usage text (not JSON), even when--jsonis present.
Related Docs
- Agent workflow guide:
llm.txt - CLI JSON contract quick reference:
cli_schema.md - CLI epoch/spec:
CLI_EPOCH.md - PDF template/XObject composition guide:
docs/pdf-templates.md - Licensing guide:
LICENSING.md - Third-party notices:
THIRD_PARTY_LICENSES.md - Living docs example project:
examples/living_docs_atlas/README.md - Roofing invoice parity example:
examples/roofing_invoice/README.md - Iconography smoke example:
examples/iconography_test/README.md - Public golden regression suite:
goldens/README.md
License
Fullbleed is licensed under the MIT License (MIT). Commercial use,
modification, distribution, and use in proprietary software are permitted
subject to the notice-preservation requirement in LICENSE.
Cargo and PyPI metadata both declare MIT.
- Copyright notice:
COPYRIGHT - Third-party notices:
THIRD_PARTY_LICENSES.md - Practical licensing guide:
LICENSING.md
For license information, please visit fullbleed.dev or email info@fullbleed.dev.
License integrity gate (CI-friendly, no build required):