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 73 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 makes 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
{
  "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": 174, "lly": 637, "urx": 234, "ury": 697}
    },
    {
      "type": "text",
      "rect": {"llx": 177, "lly": 560, "urx": 377, "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": 258, "lly": 637, "urx": 324, "ury": 703}
    },
    {
      "type": "text",
      "rect": {"llx": 261, "lly": 560, "urx": 461, "ury": 636},
      "content": ["a-Z 0..9 +*#% and on"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    }
  ]
}