rustedf.cloud
Menu

Free classic receipt template: black and white, HTML to PDF

Published 2 min read

Free classic receipt template as a PDF: serif type, a double frame, the amount received, purpose and signature line

Free template

Use this template for free

Create a free account, make a new template in the Code mode and paste the HTML below. Then send your own data from the API.

Download the HTMLDownload the sample data

This is the classic style: a serif typeface, black and white, thin rules and a boxed table. It looks the same on any printer, in color or in black and white, and it suits formal documents. A receipt is short and it matters: it is the proof that a payment arrived. This one says who paid, when, how and how much, what the payment was for, and it has a signature line for whoever received it. Below you can download the sample PDF, copy the code and see the data it takes.

What is in the template

  • The company block with name, address and tax number.
  • The title and the number of the receipt, inside a double frame.
  • A received from block with the payer, the date and the payment method.
  • A box with the total received, in the currency and the format of the reader’s language.
  • A purpose section with a sentence, the lines the payment covers and a reference, such as the number of the invoice it settles.
  • A signature line for the company and the date, and a short note at the end.

How to use it

In the portal. Create a free account, click New template, switch to the Code mode and paste the HTML below. You get a live preview.

From the API. Download the HTML and the sample data and send both in one request. This example uses jq to put the files in the body:

Terminal window
curl -X POST https://api.rustedf.com/v1/render \
-H "Authorization: Bearer $RUSTEDF_KEY" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html receipt-classic.html --slurpfile data receipt-classic-data-en.json \
'{html: $html, data: $data[0], locale: $data[0].locale}')" \
-o receipt.pdf

Once you like the result, save the HTML as a template and call it by its id from your code.

Make it yours

  • Look. The grays of the header row and of the totals are plain hex colors in the CSS. Change them, or make them white, to print with less ink.
  • Lines and amount. The lines list holds what the payment covers and amount is the total. Send amounts as strings, such as "2400.00", and work the total out in your own system.
  • Logo. Add your logo as <img src="asset:<id>" width="120"> after uploading a PNG or JPEG once.
  • Fonts. The template names PT Serif, and any Google Fonts family works by name; there is nothing to link.
  • Language. Every label comes from the t object of the data, so the same template issues documents in any language you can write.

A note on what a receipt is

A receipt confirms that a payment was made. It does not replace a tax invoice, and the rules for receipts and invoices differ by country. Check what applies to you before you issue one to a customer.

Other styles

The same data works with the other styles of this document:

See Templates / Locales and formatting.

The template code

<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <style>
      @page { size: A4; margin: 18mm; }
      body { font-family: "PT Serif", serif; font-size: 10pt; color: #000000; line-height: 1.5; }
      table { width: 100%; border-collapse: collapse; }
      td, th { vertical-align: top; }
      p { margin: 0; }
      .muted { color: #444444; }
      .right { text-align: right; }

      .frame { border: 3px double #000000; padding: 10mm 10mm 12mm 10mm; }
      .name { font-size: 15pt; font-weight: bold; margin-bottom: 1.5mm; }
      .kind { font-size: 24pt; font-weight: bold; text-transform: uppercase; letter-spacing: 4pt; text-align: right; }
      .ref { text-align: right; margin-top: 2mm; }
      .rule { border-top: 1px solid #000000; margin: 7mm 0 6mm 0; }

      .label { font-size: 8pt; font-weight: bold; text-transform: uppercase; letter-spacing: 1.4pt; margin-bottom: 1mm; }
      .fields td { padding: 0 6mm 5mm 0; width: 33%; }

      .amount { border: 1px solid #000000; background: #efefef; padding: 5mm 6mm; margin-top: 2mm; }
      .big { font-size: 24pt; font-weight: bold; line-height: 1.1; }

      h2 { font-size: 10pt; text-transform: uppercase; letter-spacing: 1.2pt; margin: 8mm 0 2mm 0; padding-bottom: 1mm; border-bottom: 1px solid #000000; }
      .lines td { padding: 2.2mm 1mm; border-bottom: 1px solid #8a8a8a; }

      .sign { margin-top: 16mm; }
      .sign td { width: 45%; padding-top: 2mm; border-top: 1px solid #000000; }
      .sign .gap { width: 10%; border-top: 0; }
      .note { margin-top: 8mm; font-style: italic; }
    </style>
  </head>
  <body>
    <div class="frame">
      <table>
        <tr>
          <td style="width: 55%">
            <p class="name">{{ company.name }}</p>
            <p class="muted">{{ company.line1 }}<br />{{ company.line2 }}<br />{{ company.tax }}</p>
          </td>
          <td>
            <p class="kind">{{ t.title }}</p>
            <p class="ref">{{ t.number }} {{ number }}</p>
          </td>
        </tr>
      </table>

      <div class="rule"></div>

      <table class="fields">
        <tr>
          <td>
            <p class="label">{{ t.received_from }}</p>
            <p><strong>{{ payer.name }}</strong><br />{{ payer.line1 }}</p>
          </td>
          <td>
            <p class="label">{{ t.date }}</p>
            <p>{{ issued | date(style="long") }}</p>
          </td>
          <td>
            <p class="label">{{ t.method }}</p>
            <p>{{ method }}</p>
          </td>
        </tr>
      </table>

      <div class="amount">
        <p class="label">{{ t.total_received }}</p>
        <p class="big">{{ amount | currency(code=currency) }}</p>
      </div>

      <h2>{{ t.purpose }}</h2>
      <p>{{ description }}</p>
      <table class="lines" style="margin-top: 3mm">
        {% for line in lines %}
        <tr>
          <td>{{ line.name }}</td>
          <td class="right">{{ line.amount | currency(code=currency) }}</td>
        </tr>
        {% endfor %}
      </table>
      <p class="muted" style="margin-top: 3mm">{{ t.reference }}: {{ reference }}</p>

      <table class="sign">
        <tr>
          <td>{{ t.received_by }} {{ company.name }}</td>
          <td class="gap"></td>
          <td>{{ t.date }}: {{ issued | date(style="long") }}</td>
        </tr>
      </table>

      <p class="note muted">{{ note }}</p>
    </div>
  </body>
</html>

The sample data

{
  "locale": "en-US",
  "currency": "USD",
  "number": "R-2025-0087",
  "issued": "2025-04-02",
  "company": {
    "name": "Aurora Studio",
    "line1": "482 Acacia Street · Austin, TX",
    "line2": "[email protected]",
    "tax": "EIN 12-3456789"
  },
  "payer": {
    "name": "Northwind Traders Inc.",
    "line1": "1500 Congress Avenue, Austin, TX"
  },
  "method": "Bank transfer",
  "reference": "Invoice 2025-0142",
  "description": "Payment received for the brand identity project, first installment.",
  "lines": [
    { "name": "Brand identity, 50% on approval", "amount": "2400.00" }
  ],
  "amount": "2400.00",
  "note": "This receipt confirms the payment above. Keep it for your records.",
  "t": {
    "title": "Receipt",
    "number": "No.",
    "received_from": "Received from",
    "date": "Date",
    "method": "Payment method",
    "total_received": "Total received",
    "purpose": "For",
    "reference": "Reference",
    "received_by": "Received by"
  }
}

← All posts