Aztec codes

Aztec is the code on rail and airline tickets in Europe, and the reason is room. Every other two-dimensional code demands a band of white all the way round it, which on a ticket the size of a bus pass is room nobody has — and that margin is the first thing somebody trims off when the layout gets tight, quietly breaking the code.

So choose Aztec when there is no room to spare. A scanner finds the rings at its centre and works outwards from there, which is why it asks for no band of white and can sit hard against a fold, an edge or the next thing printed. The three codes below also show the one setting that matters most on a code of this kind: how much damage it should still read through. The first is set where a boarding pass wants it, the second at twice that, the third at about a fifth. The more protection, the bigger the code — and the difference is plain on the page without measuring anything.

What this example shows

  • Aztec codes drawn line by line, square by square.
  • A code that sits hard against anything, thanks to the rings at its centre.
  • Three codes at three strengths of protection, biggest where it is highest.

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

Examples near this one

Code 128 and retail barcodes

Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.

QR codes

The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.

Data Matrix codes

The code industry marks small parts with: still readable at sizes where a QR code has given up, on a circuit board or a phial in a laboratory tray.

PDF417 codes

The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.

Internal and external links

A document made to be followed rather than looked at: every line of the contents lands on the page it names, and every page leads back to where it came from.

Links and marks on placed text

Links and marks hung on text the engine has already placed: a band behind a line, an underline, a boxed cell — every rectangle taken from what the layout and the table report afterwards, none of it measured by hand.

Every example, by subject