# One-page PDF invoices from an HTML template — and when you need more

> Generate one-page PDF invoices, receipts and quotes from an HTML template and your billing data — with an honest look at long invoices and e-invoicing.

Published 2026-11-07 · https://shareglint.com/en/use-cases/pdf-invoices

An invoice is a document with a fixed layout and changing data — exactly what a template is for. With Shareglint you write the invoice once in HTML and CSS, and each invoice is one request with its data, returning a **one-page vector PDF**: your logo, the customer's details, the lines, the totals. That suits receipts, simple invoices, quotes, pro formas and order confirmations. It does **not** suit long invoices that run over several pages, and it does not replace e-invoicing where the law requires it. Both limits are explained below, with what to use instead.

## What fits on one page

A template PDF is always exactly one page, the template's size in CSS pixels at 96 px per inch, with no page breaks ([PDF generation](https://shareglint.com/en/pdf-generation-api)). An A4 portrait invoice is a 794×1123 template; US Letter is 816×1056. In practice that is a header with both parties' details, a limited number of lines — how many depends on your design and font size — totals, tax lines and payment details. Content that does not fit is cut off, not moved to a second page — so decide your maximum number of lines and test the fullest invoice before going live.

## The template

There is no built-in invoice template; invoices are too specific to each business. Save your own with `POST /v1/templates`. Fields are plain values with no loops, so declare one set of fields per line up to your maximum:

```html
<div class="invoice">
  <header><img src="{{ logo }}" alt=""><h1>Invoice {{ number }}</h1><p>{{ date }} · due {{ due }}</p></header>
  <section class="parties"><div>{{ seller }}</div><div>{{ buyer }}</div></section>
  <table>
    <tr><th>Item</th><th>Qty</th><th>Price</th><th>Total</th></tr>
    <tr><td>{{ item_1 }}</td><td>{{ qty_1 }}</td><td>{{ price_1 }}</td><td>{{ total_1 }}</td></tr>
    <tr><td>{{ item_2 }}</td><td>{{ qty_2 }}</td><td>{{ price_2 }}</td><td>{{ total_2 }}</td></tr>
    <!-- … up to item_8 -->
  </table>
  <p class="sum">Net {{ net }} · VAT {{ vat }} · <b>Total {{ total }}</b></p>
  <footer>{{ payment }}</footer>
</div>
```

Compute every amount — line totals, tax, the total — in your billing code and send them as formatted text; the template does no arithmetic. Unused lines stay empty. Every field in the HTML must be declared in the template's `fields`, or saving fails, which catches typos early.

## One invoice per request

```bash
curl -X POST "https://shareglint.com/v1/images?wait=true" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "template": "invoice-a4",
    "format": "pdf",
    "modifications": {
      "number": "2026-0412", "date": "7 Nov 2026", "due": "21 Nov 2026",
      "seller": "Northwind Ltd, 1 Harbour St, London", "buyer": "Acme GmbH, Hauptstr. 5, Berlin",
      "item_1": "Annual subscription", "qty_1": "1", "price_1": "€1,200.00", "total_1": "€1,200.00",
      "net": "€1,200.00", "vat": "€0.00 (reverse charge)", "total": "€1,200.00",
      "payment": "IBAN GB00 NWBK 0000 0000 0000 00 · Ref 2026-0412"
    }
  }'
```

The response's `url` is the PDF. For month-end runs, send all invoices as a batch with `"format": "pdf"`, one row per invoice and the invoice number as `filename`, and receive every PDF and one ZIP. Rows per batch by plan: Free 50, Starter 500, Pro 1,000, Scale 2,000, Business 5,000.

Store the PDF in your own system once it is generated: our copy is kept for your plan's retention period (365 days on paid plans), while invoices usually have to be kept for years.

## When you need more than one page

Invoices with dozens of lines, statements, reports and contracts need **pagination**: rows flowing onto the next page, table headers repeated on each page, page numbers in the footer. Template PDFs do none of that, by design. Two good routes:

- **Puppeteer's [`page.pdf()`](https://pptr.dev/api/puppeteer.page.pdf)** with CSS `@page` rules, `thead` repeated across pages and a page-number footer. Our [Puppeteer PDF guide](https://shareglint.com/en/guides/puppeteer-pdf) shows each of these working.
- **A document API** built for long PDFs, if you would rather not run Chrome yourself; several are named on our [PDF generation](https://shareglint.com/en/pdf-generation-api) page.

## PDF invoices and e-invoicing

A PDF invoice is for people. More and more tax systems want invoices as **structured data** that software can read. The European Commission describes an electronic invoice as one "issued, transmitted and received in a structured data format which allows for its automatic and electronic processing", with EN 16931 as the European standard ([European Commission, eInvoicing](https://ec.europa.eu/digital-building-blocks/sites/display/DIGITAL/eInvoicing)). Where e-invoicing is mandatory for you — in public procurement, and in a growing number of countries for business invoices too — the legal invoice comes from your accounting or e-invoicing system, and a generated PDF is at most a readable copy. Check your country's rules before relying on PDFs alone.

## Receipts, quotes and confirmations

The same approach works for any one-page commercial document: a receipt after a card payment, a quote with a validity date, an order confirmation, a delivery note. They share the invoice template's header and footer and differ only in the middle; keep one template per document type so each stays simple.

## Getting the details right

Invoices are legal documents in most countries, and the details are checked: a sequential number, the date of issue and of supply, both parties' names, addresses and tax numbers, each line's quantity, price and tax rate, the totals per tax rate, and payment terms. What is required depends on your country and your customer's; your accountant or your billing software knows the list. The template only shows what you send, so build the data from your billing system, not by hand, and keep one tested template per country if the requirements differ.

## Cost

One render per PDF; repeats with the same values are free. Five hundred invoices a month are 500 renders. The Free plan's 100 renders carry a watermark, which an invoice must not have; Starter is $9 a month for 2,000 renders ([pricing](https://shareglint.com/en/pricing)).

## What it does not do

- No multi-page documents, page numbers or repeated headers.
- No calculations: totals and tax come from your billing code.
- No e-invoice formats (XML, EN 16931 syntaxes), digital signatures or PDF/A.
- No long-term archive: store the PDFs in your own system.

## FAQ

### Can I generate PDF invoices with this API?

Yes, if each invoice fits on one page: a receipt, a simple invoice, a quote or a pro forma with a handful of lines. You write the invoice as an HTML template and send each invoice's data; the PDF is one page, vector, the size of the template.

### What about invoices with many line items?

They need pagination — line items flowing onto a second page, repeated table headers, page numbers — which template PDFs do not do. Use Puppeteer's page.pdf or a document API built for long documents; our Puppeteer PDF guide shows how.

### Is a PDF invoice an e-invoice?

No. In the EU, an electronic invoice is structured data that software can process, under the European standard EN 16931; a PDF is a human-readable copy. Where e-invoicing is mandatory, the structured invoice comes from your accounting or e-invoicing system.

### How do I show line items in a template?

Template fields are plain values, with no loops. For a fixed maximum of lines, declare fields such as item_1 to item_8 with quantity and price; empty fields leave their line blank.
