A Till Receipt on a Paper Roll

A counter till prints on a roll 80 mm across, and a roll has no bottom edge: the paper is cut where the basket ends. So the page is as long as what was bought, and not a figure on it is written down beforehand. A line comes to its quantity times its unit price, the tax at each rate is taken out of the gross that carries it, and the change is what is left of the note handed over. Ring up one article more and the roll grows by one line, with the totals still under it.

The barcode at the foot is what the shop scans when the ticket comes back — a return, an exchange, a warranty claim. Nothing chooses its code set by hand: the library reads the ticket number, finds nothing in it but digits, and packs it two digits to a symbol, 112 modules where spelling the number out character by character would take 189. Whether it scans is for a scanner to say, and one does say: a decoder is pointed at the rendered page and reads the number back.

What This Example Shows

  • A roll 80 mm across, cut as long as the basket makes it.
  • Six articles, the tax gathered by rate, and the change worked out from the note handed over.
  • The ticket number carried as a barcode, in the code set the library picks for it.

The Source Code, Complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The Document Itself

Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

A Till Receipt on a Paper Roll, first page

The Same Document in Other Languages

This document weighs 17.3 kB

Examples Near This One

A Commercial Invoice

An invoice: each billed line follows the one before, the totals sit under the last, and the QR code holds the transfer. The customer points a telephone at it, and the banking app offers the exact sum into the exact account, with nothing retyped.

A Delivery Note

The note that travels with the goods: a barcode against each article, a box the receiver ticks, and the consignment's own code.

A Payslip

A payslip: eighteen contribution lines, with the employee's share and the employer's, and for each the month's amount then the total since January. Each figure is tied to the line and the column it stands under, for software that reads the page aloud.

A Landscape Certificate

A certificate whose border, ribbon and seal are drawn as lines rather than photographed: sharp at any size, and a fraction of the weight.

A Boarding Pass

A boarding pass carrying, as a QR code, the one line the gates at an airport read — one character out of place and it is refused.

Every example, by subject