Use case

Generate PDF invoices
without the complexity

Send an HTML invoice template, get a pixel-perfect PDF back. Works in Laravel, Node.js, Python, Ruby. No binaries, no server config.

Why invoice PDF generation is painful today

DomPDF

No flexbox or CSS Grid. Invoice layouts break or require table-based workarounds. CSS support is frozen years behind modern standards.

wkhtmltopdf

Archived binary with no more updates. Requires system installation, conflicts with Docker, no ARM64 support.

Puppeteer

Runs Chromium on your server. 200–300 MB RAM per conversion, cold-start delays, and crashes under concurrent load.

A cleaner approach

Render your invoice template to HTML, POST it to the API, stream the bytes. That's the entire integration.

Laravel: generate and stream an invoice PDF
use HtmlToPdfApi\Laravel\Facades\HtmlToPdf;

Route::get('/invoices/{invoice}.pdf', function (Invoice $invoice, Request $request) {
    $html = view('invoices.pdf', compact('invoice'))->render();

    return HtmlToPdf::html($html)
        ->paperSize('a4')
        ->margins(top: 40, bottom: 40)
        ->footer('<div style="text-align:center;font-size:9px">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>')
        ->generate()
        ->toResponse($request);
});

Everything invoices need

Page numbering (Page N of M)
Custom headers and footers
A4, Letter, and custom sizes
Modern CSS: flexbox, grid, custom fonts
Inline or attachment download
Email-ready bytes for attachments
Typed error handling per language

Start generating invoice PDFs free

200 pages/day on the free tier. No credit card required.

Get your free API key