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.
Summary
It reads with no white margin around it, so it fits where other codes cannot: right at the edge of a small ticket, or in the last free corner of a boarding pass. The larger the share of the square kept for safety, the better the code reads when creased or stained, and the denser it gets. Say nothing about it and the share is the one the standard recommends.
Technically
Asked for with
"type": "aztec"
The symbol is square, its modules drawn as filled squares, and it 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.
Request schema
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 rectangle; 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 creates a PDF
{
"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 JSON key of a request, in one page The other twenty-two things you can draw