● A rendering engine designed from the ground up
● No Chrome, WebKit, or headless browsers
● Built for concurrency and deterministic output
Install it and render PDF invoices or emails easily with a single function call - or drive high-volume, true-to-scale documents with the same templating and pagination engine. HTML to PDF, but not web to print: a PDF generation and reporting engine that speaks in modern design languages
pip install fullbleed
engine_config.py
FullBleed
PDF Engine
engine = fullbleed.PdfEngine(
page_width="8.5in",
page_height="11in",
margin=24,
# Engine-level page template selection by page index.
# Page 1 uses a tighter top margin; page 2 and page n reserve extra top space.
page_margins={
1: {"top": "12mm", "right": "12mm", "bottom": "12mm", "left": "12mm"},
2: {"top": "28mm", "right": "12mm", "bottom": "12mm", "left": "12mm"},
"n": {"top": "28mm", "right": "12mm", "bottom": "12mm", "left": "12mm"},
},
reuse_xobjects=True,
font_dirs=font_dirs,
font_files=["fonts/USPSIMBStandard.ttf"] + font_files,
# HTML/CSS header snippet (applies to pages after page 1).
header_html_each=(
'<div class="continued-header">'
'<div class="continued-left">FullBleed Bank</div>'
'<div class="continued-right">Statement Continued · Page {page} of {pages}</div>'
"</div>"
),
header_html_x="12mm",
header_html_y_from_top="6mm",
header_html_width="186mm",
header_html_height="12mm",
paginated_context={
"items.amount": "sum",
},
footer_each="Subtotal (Page {page}): ${sum:items.amount}",
footer_last="Grand Total: ${total:items.amount}",
footer_x="12mm",
footer_y_from_bottom="10mm",
)