The journal · 19 November 2026 · 6 min read
PDFKit Alternative for Invoices and What Maintaining Coordinates Costs a Year
PDFKit draws pages with coordinates and has no table. Three invoice templates cost about $4,800 in year one to build and change, against about $1,488 for HTML templates and an API plan.
Live demo
Runs in your browser. Nothing is uploaded. One PDF free to try, then a plan.
Your HTML
Live preview
Your PDF is downloading. That was the free one. The Starter plan converts as many as you need, for $49 a month or $288 a year, half price.
See the planPDFKit is a good library for drawing a PDF from Node. It is a poor fit for the moment a finance team asks for the invoice to look like the one in the app, with a new logo, a longer line item table and a second language. Teams then search for a PDFKit alternative, and the real question is whether to keep writing coordinates or let a browser lay the page out. This post puts numbers on that choice.
The short answer
Keep PDFKit when the document is small, fixed and drawn once, such as a ticket or a label. Switch to an HTML to PDF approach when the document is a table-heavy invoice, statement or report that changes every quarter. In the example below, changing and maintaining three PDFKit templates for a year costs about $4,800 in engineering time against $588 for a 50,000 render API plan, because layout work moves from JavaScript coordinates to HTML and CSS that the team already knows.
What does PDFKit actually do?
PDFKit, documented at pdfkit.org, is a low level Node and browser library. You create a document and call drawing methods: text(), moveTo(), lineTo(), image(). It does not read HTML or CSS. There is no table primitive in the core library, so every row, every column edge and every page break is code you write.
const doc = new PDFDocument({ margin: 40 });
doc.fontSize(20).text('Invoice 1042', 40, 40);
let y = 120;
for (const line of invoice.lines) {
if (y > 740) { doc.addPage(); y = 60; } // page break is your job
doc.fontSize(10)
.text(line.description, 40, y, { width: 260 })
.text(line.qty, 310, y)
.text(money(line.total), 480, y, { align: 'right', width: 70 });
y += 18; // wrong the day a description wraps
}
That works until a description wraps to two lines. The fix is to measure each cell with heightOfString(), take the maximum across columns, and advance y by that. Then repeat the table header after a page break. Each of those is reasonable on its own. Together they are a small layout engine you now own.
How much work is a PDFKit invoice to maintain?
These are planning assumptions, not measurements, so replace them with your own. A team has three document types: invoice, credit note and monthly statement. Each takes about 10 hours to build to production quality in PDFKit, including wrapped cells, repeating headers, totals that stay with the last row and a logo. Each then needs about 6 hours of changes a year: new tax lines, a new address block, a translated version. Engineering time is valued at $100 an hour.
| Item | Basis | Year one cost |
|---|---|---|
| Build 3 templates in PDFKit | 30 hours at $100 | $3,000 |
| Template changes | 18 hours at $100 | $1,800 |
| PDFKit total | $4,800 | |
| HTML templates, one-off conversion | about 3 hours each at $100 | $900 |
| SitePDF Growth, 50,000 renders a month | $99 list, about $49 a month on yearly billing | $588 |
| HTML plus API total | $1,488 |
The HTML route is cheaper in year one even after paying to convert the templates, and the gap widens in year two because only the $588 repeats. The assumption most worth challenging is the 3 hours per template. If your invoices are already HTML on screen, it is closer to zero.
What does an HTML template give you that coordinates do not?
A browser lays out text, wraps cells, applies fonts and cuts pages. CSS has thead { display: table-header-group } so a table header repeats on every page, and break-inside: avoid keeps a row together. Designers and front end developers can change the invoice without touching the PDF code, and the customer-facing screen and the PDF can share one template. If page cuts are where you are stuck, HTML to PDF page breaks shows the CSS in detail.
Text stays real text. Fonts embed as subsets, so a three page invoice remains small and the customer's accounting tool can read the numbers. That matters more than it sounds: an invoice that cannot be searched or copied generates support tickets.
Can I keep PDFKit and still avoid the layout code?
Partly. Libraries that sit on top of PDFKit add tables and flow layout, but you stay inside a JavaScript object model that only your developers can edit. If the goal is to let others change the template, or to match the on-screen design, HTML is the shorter path. The HTML to PDF Node.js page shows the swap, and the jsPDF alternative page covers the browser-side equivalent of the same problem.
When PDFKit is still the right choice
Choose PDFKit for documents with fixed positions and little text flow: boarding passes, certificates, labels, QR sheets. It has no browser dependency, starts instantly and produces tiny files. It is also reasonable when you must run fully offline and cannot call an external service. For invoice-shaped documents the economics tip the other way, and the invoice PDF API post covers the extras that matter there: archive copies, retries and numbering.
What to do this week
Time how long your last template change took, from request to deploy. Multiply by your yearly count of changes. If the figure is above the API plan, render one real invoice both ways and compare the output. SitePDF takes the HTML you already have, returns a PDF link and, with archive=true, stores a dated copy of what the customer received. For the broader library versus service decision, HTML to PDF library vs API has the full comparison.
Frequently asked questions
Is PDFKit good for invoices?
It can produce invoices, but you build the table yourself: column positions, wrapped cells, repeating headers and page breaks. That is fine for one fixed layout and costly when the layout changes often. HTML with CSS handles those parts natively.
Does PDFKit support HTML?
No. PDFKit has no HTML or CSS parser. You describe the page with drawing calls and coordinates. To start from HTML you need a browser based renderer such as Puppeteer, Playwright or an HTML to PDF API.
What is a good alternative to PDFKit?
For flowing documents with tables, a Chromium renderer is the usual choice, either self-hosted or as an API. For drawn documents, pdf-lib is a close library level alternative. The right one depends on whether the layout is fixed or text-driven.
How do I make a table in PDFKit?
Core PDFKit has no table method. You position each cell with text() at computed x and y values, measure wrapped text with heightOfString() and add pages manually. Plugins add a table helper, but the layout stays in JavaScript.
Written by the team behind SitePDF, an HTML to PDF API that archives every page it renders. The in-browser converter is free to try, and API plans start at $49 a month, half price billed yearly.