write_aztec.json

The JSON file of the “Aztec Codes” example. The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.

JSON 197 lines

This file is a request: an application sends it over the network to the server, which creates the PDF and sends it back. It creates the same page as the Rust and Python versions of this example. A request names every file it uses, never its content; the call carries the request and the files together. A font the server already holds, such as DejaVuSans, is named with nothing attached. Send the request to the address the API page gives.

What This Example Is For

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.

What This Example Shows

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
{
  "metadata": {
    "title": "Aztec codes, drawn as squares"
  },
  "items": [
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 794, "urx": 523.276, "ury": 813.2},
      "content": [
        "Aztec codes, drawn as squares"
      ],
      "font": "DejaVuSans",
      "font_size": 16
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 770, "urx": 523.276, "ury": 782.6},
      "content": [
        "An Aztec code asks for no white margin around it, so it fits where nothing else"
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 755, "urx": 523.276, "ury": 767.6},
      "content": [
        "would; a train ticket carries one. Beside each is what a scanner reads back."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "aztec",
      "content": "HQF2026 PARIS LONDON 14B 07JUL",
      "correction": 23,
      "rect": {"llx": 72, "lly": 643, "urx": 129, "ury": 700}
    },
    {
      "type": "text",
      "rect": {"llx": 141, "lly": 600, "urx": 341, "ury": 679.5},
      "content": ["HQF2026 PARIS LONDON 14B 07JUL"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "aztec",
      "content": "https://example.test/track/FR-1964413",
      "correction": 46,
      "rect": {"llx": 72, "lly": 556, "urx": 141, "ury": 625}
    },
    {
      "type": "text",
      "rect": {"llx": 153, "lly": 520, "urx": 353, "ury": 598.5},
      "content": ["https://example.test/track/FR-1964413"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "aztec",
      "content": "a-Z 0..9 +*#% and on",
      "correction": 5,
      "rect": {"llx": 72, "lly": 481, "urx": 129, "ury": 538}
    },
    {
      "type": "text",
      "rect": {"llx": 141, "lly": 440, "urx": 341, "ury": 517.5},
      "content": ["a-Z 0..9 +*#% and on"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "aztec",
      "content": "HQF AZTEC 2026",
      "rect": {
        "llx": 330,
        "lly": 655,
        "urx": 375,
        "ury": 700
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 666.5,
        "urx": 982.276,
        "ury": 682.5
      },
      "content": "HQF AZTEC 2026",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 655.5,
        "urx": 982.276,
        "ury": 671.5
      },
      "content": "compact, layers: 1, dark modules: 117",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "aztec",
      "content": "AZTEC BYTES",
      "rect": {
        "llx": 330,
        "lly": 592,
        "urx": 375,
        "ury": 637
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 603.5,
        "urx": 982.276,
        "ury": 619.5
      },
      "content": "AZTEC BYTES",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 592.5,
        "urx": 982.276,
        "ury": 608.5
      },
      "content": "compact, layers: 1, dark modules: 113",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "aztec",
      "content": "LOT 4472",
      "correction": 50,
      "rect": {
        "llx": 330,
        "lly": 529,
        "urx": 375,
        "ury": 574
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 540.5,
        "urx": 982.276,
        "ury": 556.5
      },
      "content": "LOT 4472",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 387,
        "lly": 529.5,
        "urx": 982.276,
        "ury": 545.5
      },
      "content": "compact, layers: 1, dark modules: 121",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    }
  ]
}