An Aztec code, with no white margin around it
Draw an Aztec code, the one on train tickets: square, needing no margin, with the share of safety you choose.
Asked for with
"type": "aztec"
In plain words
Written for anybody. It says what this puts on a sheet of paper, and asks nothing of you beyond that.
This is the square you see on train tickets and boarding passes. Its knack is simple: it reads with no white margin around it, so it fits where other codes cannot, right at the edge of a small ticket. You give the text to carry, the frame, and the share of the square kept for safety: the larger that share, the better the code reads when creased or stained, and the denser it gets. Say nothing about it and the safety share is the one the standard recommends.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
The symbol is square and fills the rectangle's whole width, anchored at the lower-left corner; it takes the full width, since an Aztec code reads without a quiet zone. The share kept for error correction is given as a percentage, from 0 to 90; absent, it is 23 %, the value the standard recommends. The symbol's size follows the length of the text and the correction share asked for. The item draws the code alone: the readable reference is laid beside it with a text item.
Every key, with its default
The reference: which keys are required, which are optional, what each one defaults to and which combinations the server declines.
Required keys: content, a string; rect. Optional: correction, an integer from 0 to 90, the share of the symbol given to error correction, default 23; pages, an array of one-based integers, default empty; transform, six numbers; rotate, degrees counter-clockwise about the centre of the box; layer, the name of a declared layer. Cross refusal: transform together with rotate. A correction above 90, or text longer than the largest symbol carries, answers 400.
A whole request that draws it
Post this as it stands and a PDF comes back. Nothing has been left out of it.
{
"items": [
{
"type": "aztec",
"content": "HQF2026 PARIS LONDON 14B 07JUL",
"rect": {"llx": 72, "lly": 700, "urx": 129, "ury": 757}
}
]
}
Barcodes and square codes
A barcode of vertical bars A square QR code, read with a phone A Data Matrix code, very small and very sturdy A PDF417 code, carrying a whole form
Where to go next
Every key of a request, in one page The other twenty things you can draw
Glossary
- standard
- A rule argued out in committee, published under a number anybody may buy and read, and identical for every firm claiming it. A claim to follow one can therefore be checked against the text. A way of working that merely spread because it worked is a habit of the trade: useful, widespread, and answerable to no text at all.
- Aztec
- The code with a little target in the middle, the one on a train ticket or on a boarding pass held up on a phone screen. It was made to be read off a lit screen and through a scratched window, and it takes less room than the others for the same text.
- layer
- A named group of things drawn on a page that a reader can switch on and off, like tracing paper laid over a plan. A drawing can hold its measurements on one and its notes on another, and a layer can be set to show on screen and stay off the printer.