write_datamatrix.json

The JSON file of the “Data Matrix Codes” example. 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.

JSON 348 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

Data Matrix is what industry marks small parts with. It stays readable at sizes where a QR code has given up, and its rectangular shapes go onto components and labels that have no room for a square: a circuit board, a surgical instrument, a phial in a laboratory tray.

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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
{
  "metadata": {
    "title": "Data Matrix codes, drawn as squares"
  },
  "items": [
    {
      "type": "text",
      "rect": {
        "llx": 72,
        "lly": 794,
        "urx": 523.276,
        "ury": 813.2
      },
      "content": [
        "Data Matrix codes, drawn as squares"
      ],
      "font": "DejaVuSans",
      "font_size": 16
    },
    {
      "type": "text",
      "rect": {
        "llx": 72,
        "lly": 770,
        "urx": 523.276,
        "ury": 782.6
      },
      "content": [
        "A Data Matrix holds as much as a QR code in less room, which is why it is found"
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "text",
      "rect": {
        "llx": 72,
        "lly": 755,
        "urx": 523.276,
        "ury": 767.6
      },
      "content": [
        "on small parts and on parcels. Under each one is what a scanner reads back."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "data_matrix",
      "content": "https://example.test/track/FR-1964413",
      "rect": {
        "llx": 72,
        "lly": 637,
        "urx": 150,
        "ury": 715
      }
    },
    {
      "type": "text",
      "rect": {
        "llx": 75,
        "lly": 560,
        "urx": 275,
        "ury": 636
      },
      "content": [
        "https://example.test/track/FR-1964413"
      ],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "data_matrix",
      "content": "SN:2026-07-19/ACME-4472",
      "rect": {
        "llx": 257.582,
        "lly": 637,
        "urx": 317.582,
        "ury": 697
      }
    },
    {
      "type": "text",
      "rect": {
        "llx": 260.582,
        "lly": 560,
        "urx": 460.582,
        "ury": 636
      },
      "content": [
        "SN:2026-07-19/ACME-4472"
      ],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "data_matrix",
      "content": "a-Z 0..9 +*#% and on",
      "rect": {
        "llx": 396.789,
        "lly": 637,
        "urx": 462.789,
        "ury": 703
      }
    },
    {
      "type": "text",
      "rect": {
        "llx": 399.789,
        "lly": 560,
        "urx": 599.789,
        "ury": 636
      },
      "content": [
        "a-Z 0..9 +*#% and on"
      ],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "data_matrix",
      "content": "SN 2026 RECT",
      "shape": "rectangle",
      "rect": {
        "llx": 72,
        "lly": 507,
        "urx": 174,
        "ury": 537
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 75,
        "lly": 482,
        "urx": 670.276,
        "ury": 498
      },
      "content": "SN 2026 RECT",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 75,
        "lly": 472,
        "urx": 670.276,
        "ury": 488
      },
      "content": "8 × 32",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "data_matrix",
      "content": "SIZE 24",
      "size": {
        "height": 24,
        "width": 24
      },
      "rect": {
        "llx": 202,
        "lly": 507,
        "urx": 280,
        "ury": 585
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 205,
        "lly": 482,
        "urx": 800.276,
        "ury": 498
      },
      "content": "SIZE 24",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 205,
        "lly": 472,
        "urx": 800.276,
        "ury": 488
      },
      "content": "24 × 24",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "data_matrix",
      "content": "DM BYTES",
      "rect": {
        "llx": 332,
        "lly": 507,
        "urx": 380,
        "ury": 555
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 335,
        "lly": 482,
        "urx": 930.276,
        "ury": 498
      },
      "content": "DM BYTES",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 335,
        "lly": 472,
        "urx": 930.276,
        "ury": 488
      },
      "content": "14 × 14",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "data_matrix",
      "content": "DM RECT",
      "shape": "rectangle",
      "rect": {
        "llx": 72,
        "lly": 377,
        "urx": 174,
        "ury": 407
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 75,
        "lly": 352,
        "urx": 670.276,
        "ury": 368
      },
      "content": "DM RECT",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 75,
        "lly": 342,
        "urx": 670.276,
        "ury": 358
      },
      "content": "8 × 32",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "data_matrix",
      "content": "DM 20",
      "size": {
        "height": 20,
        "width": 20
      },
      "rect": {
        "llx": 202,
        "lly": 377,
        "urx": 268,
        "ury": 443
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 205,
        "lly": 352,
        "urx": 800.276,
        "ury": 368
      },
      "content": "DM 20",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 205,
        "lly": 342,
        "urx": 800.276,
        "ury": 358
      },
      "content": "20 × 20",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "text",
      "rect": {
        "llx": 72,
        "lly": 320,
        "urx": 523.276,
        "ury": 332.6
      },
      "content": [
        "The last code holds 210 dark modules out of 400."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    }
  ]
}