How to convert an html invoice to a pdf for dispatch
- Step 1Populate and export the invoice HTML — Fill in customer details, line items, and totals in your HTML template, then save the rendered result as a
.htmlfile (your billing system's 'View/Export HTML', or File → Save Page As → HTML Only). - Step 2Open the converter and drop the file — Load it into the HTML to PDF converter. Parsing is local — the invoice never leaves your browser. Upload is the only input path.
- Step 3Let it extract the invoice text — CSS and scripts are removed; tags (including the line-item
<table>) become line breaks; the four core entities decode. Output is 10pt Helvetica on US-Letter — no page-size or layout control. - Step 4Verify the figures, not the look — Open the PDF and confirm the invoice number, dates, each line item's text, subtotal, tax, and grand total are correct. The visual layout and logo won't be there — that's expected.
- Step 5For a branded invoice, use a faithful render — If the customer needs a polished invoice, use your billing system's native PDF export, the browser's Print → Save as PDF, or screenshot the rendered invoice and run it through image-to-pdf.
- Step 6Attach and send — Attach the resulting PDF to the customer email. If you used the text-only output, consider noting that it's a plain copy and that a formatted version is available on request.
Invoice element → PDF outcome
How a typical HTML invoice's parts survive text extraction.
| Invoice element | In the PDF? | Note |
|---|---|---|
| Invoice number, dates, PO ref | Kept | All appear as text lines in document order. |
| Bill-to / ship-to text | Kept | Names and addresses survive (Latin-1 only). |
| Line-item table | Flattened to lines | Description and amount land on separate lines; columns don't align. |
| Subtotal / tax / total | Kept | Figures survive — verify they read correctly after flattening. |
| Payment terms / notes | Kept | Footer text is included. |
| Company logo / brand graphics | Discarded | No image embedding; logo is dropped. |
| Styled layout (header bar, colors) | Discarded | All CSS removed; output is plain black text. |
| Currency symbols (€, £, accented names) | Risky | Non-Latin-1 glyphs may not render in Helvetica. |
Paths to a send-ready invoice
Match the method to how polished the invoice needs to be.
| Need | Best method | Why |
|---|---|---|
| A quick text copy / internal record | html-to-pdf (this tool) | Fast, private, captures all figures. |
| A branded invoice the customer sees | Billing system's native PDF export | Built for fidelity — keeps logo, layout, fonts. |
| Branded but no native export | Print → Save as PDF, or screenshot → image-to-pdf | Preserves the rendered look. |
| Password-protect before sending | pdf-password-protect | Encrypt the invoice PDF after generating it. |
Cookbook
Invoice recipes. 'Before' is the template HTML; 'after' is the PDF text. Figures are illustrative.
Header and totals come through cleanly
The non-tabular parts of an invoice — number, dates, terms, totals — extract perfectly. This is fine for an internal record or a plain copy.
Before (invoice HTML, abridged): <h1>Invoice INV-2048</h1> <p>Date: 2026-06-06 · Due: 2026-07-06</p> <p>Total due: 1,240.00 GBP</p> After (PDF text): Invoice INV-2048 Date: 2026-06-06 · Due: 2026-07-06 Total due: 1,240.00 GBP
The line-item table flattens
This is the key limitation for invoices: the items table collapses to one line per cell, so descriptions and amounts no longer sit side by side. Verify carefully, or use a faithful render for customer-facing copies.
Before: <table> <tr><td>Consulting (10h)</td><td>1,000.00</td></tr> <tr><td>Hosting</td><td>240.00</td></tr> </table> After (PDF text): Consulting (10h) 1,000.00 Hosting 240.00
The logo is dropped — plan for a branded version
Base64 or URL logos are both stripped; the converter never embeds images. For the customer-facing invoice you'll want the billing system's PDF or an image-based render.
Before: <img src="data:image/png;base64,iVBOR..." alt="Acme"> <h1>Invoice INV-2048</h1> After (PDF text): Invoice INV-2048 (logo image removed; alt text not guaranteed)
Currency and accented names need care
Helvetica is Latin-1. A euro sign or an accented customer name can fail to render. Use plain 'EUR' / 'GBP' text, or render the invoice as an image for those cases.
Before: <p>Total: €1.240,00 — Bill to: José Núñez</p> Risk: €, é, ñ may not render in Helvetica. Safer source: <p>Total: EUR 1,240.00 — Bill to: Jose Nunez</p> (or screenshot → image-to-pdf to keep accents)
Generate, then encrypt before emailing
Invoices often carry sensitive details. After generating the PDF, add a password so only the customer can open it.
1. html-to-pdf → invoice.pdf 2. pdf-password-protect → invoice-locked.pdf 3. Email the locked PDF; share the password through a separate channel
Edge cases and what actually happens
The line-item table is misaligned
FlattenedTables collapse to one line per cell, so descriptions and amounts stack instead of aligning in columns. For a customer-facing invoice, use the billing system's native PDF or screenshot → image-to-pdf.
The company logo is missing
By designThe converter draws text only and never embeds images — base64 and URL logos are both dropped. Use a faithful render for branded invoices.
Currency symbol (€/£) or accented name won't render
Render errorHelvetica is Latin-1, so the euro sign and many accented characters can't be drawn and may error or drop. Use plain currency codes (EUR/GBP) and ASCII names, or render as an image via image-to-pdf.
Invoice rendered by a JS billing app
Empty resultScripts are stripped and never run; if your invoice DOM is built at runtime, save the fully-rendered HTML first or the PDF will be blank.
Very long description lines get cut
TruncatedLines clip at 100 characters with no wrap, so a long item description loses its tail. Shorten descriptions or pre-wrap them in the source.
You wanted A4 for an EU customer
By designOutput is always US-Letter. Convert here, then resize to A4 with pdf-resize if needed.
High-volume automated invoicing
Out of scopeThis is a manual, browser-side tool — not a batch invoice pipeline. For production automation generating branded PDFs, render server-side with a headless browser (Puppeteer/Playwright) or wkhtmltopdf.
Invoice HTML over the free 2 MB limit
413 blockedAn embedded base64 logo can push a small invoice over 2 MB. Remove the inline image (you're not keeping it anyway) or upgrade to Pro (50 MB).
Frequently asked questions
Will my customer get a polished, branded invoice from this?
No. This extracts the invoice text into a plain 10pt Helvetica PDF — no logo, no layout, and the line-item table flattens. It's good for an internal record or a plain copy. For a branded invoice, use your billing system's native PDF export, the browser's Print → Save as PDF, or screenshot → image-to-pdf.
Will my company logo appear in the PDF?
No. The converter draws text only and never embeds images — base64 and URL logos are both stripped. To keep the logo, render the invoice as an image and use image-to-pdf, or use a native PDF export.
Do the line items stay in a proper table?
No. The line-item table flattens to one line per cell, so descriptions and amounts no longer align in columns. Verify the figures, and for customer-facing copies use a faithful render.
Can I automate HTML invoice to PDF conversion at scale?
Not with this tool — it's manual and browser-side. For production automation that also keeps branding, use a headless browser (Puppeteer/Playwright) or wkhtmltopdf in your backend. This tool suits one-off or low-volume plain copies.
Will currency symbols and accented names render?
Not reliably. Helvetica is Latin-1, so €, some £ encodings, and accented letters can fail. Use plain currency codes (EUR/GBP) and ASCII names in the source, or render the invoice as an image to keep them.
Can I set the page to A4?
No — output is always US-Letter (612×792pt). Convert here, then change the size with pdf-resize if you need A4 for an EU customer.
Is my billing data uploaded anywhere?
No. Everything runs in your browser via pdf-lib, so customer names, amounts, and terms stay on your device. Only anonymous usage counts are recorded when signed in.
Can I password-protect the invoice before sending?
Yes. Generate the PDF here, then encrypt it with pdf-password-protect and share the password through a separate channel.
Can I send the resulting PDF as a valid VAT invoice?
A PDF invoice can be a valid VAT invoice if it contains all required fields. But the text-only output here drops your branding and may misalign line items — for a compliant, customer-ready invoice use a faithful render, and confirm the required fields with your accountant.
Why is a long item description cut off?
Lines are truncated at 100 characters with no word-wrap. Long descriptions lose their tail. Shorten or pre-wrap them in the source HTML.
What if my invoice template is a JavaScript app?
Scripts are stripped and never run, so a runtime-rendered invoice yields a blank PDF. Save the fully-rendered HTML first, or use the browser's Print → Save as PDF which executes the page.
How many invoices can I convert at once?
Free is one file at a time, up to 2 MB. Pro raises the cap to 50 MB and allows batches of up to 5 files for a small billing run.
Privacy first
All PDF processing runs locally in your browser using PDF-lib and pdf.js. No file is ever uploaded — only metadata counters are saved for signed-in dashboard stats.