A PDF417 code, carrying a whole form
Draw a PDF417 code of stacked bars, the one on boarding passes: it carries a whole form, not merely a number.
Asked for with
"type": "pdf417"
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 rectangle of bars stacked in several rows, the one on boarding passes and on some official documents. Its strength is carrying a whole form: a name, a date, a flight number, all in one code. You give the text, the frame, and if you like the number of columns, which decides the rectangle's shape. You also set the sturdiness: the more you ask for, the better the code survives a crease or a stain, and the more room it takes.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
The symbol and the quiet zone on either side fill the rectangle's width, anchored at the lower-left corner. The depth that comes out follows from the width: a module is drawn three times as tall as it is wide. The number of data columns runs from 1 to 30; left out, the encoder picks a shape about twice as wide as it is tall. The correction level runs from 0 to 8, each level costing twice what the one below costs; left out, it takes the level the standard asks for at that text length.
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: columns, an integer from 1 to 30 (default: the encoder's pick, about twice as wide as it is tall); level, an integer from 0 to 8 (default: the level the standard asks for at that length); 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. Text longer than the largest symbol, or than the requested shape, 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": "pdf417",
"content": "HQF/2026-08-08/PARIS/14B",
"rect": {"llx": 72, "lly": 660, "urx": 283, "ury": 720}
}
]
}
Barcodes and square codes
A barcode of vertical bars A square QR code, read with a phone An Aztec code, with no white margin around it A Data Matrix code, very small and very sturdy
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.
- 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.