fullbleed

Data-to-PDF solutions are stuck in the past. Use our rust powered python api to use HTML/CSS to template PDFs quickly and correctly

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",
)

Contact us

Interested in working together? Fill out some info and we will be in touch shortly. We can’t wait to hear from you!