write_qr.json

Die JSON-Datei des Beispiels „QR-Codes“. Der Code, den eine Rechnung, eine Bordkarte oder ein Etikett am Ende braucht, in das Dokument gezeichnet statt als Bild geholt und eingefügt.

JSON 185 Zeilen

Diese Datei ist eine Anfrage: Eine Anwendung sendet sie über das Netz an den Server, der das PDF erzeugt und zurücksendet. Sie erzeugt dieselbe Seite wie die Rust- und die Python-Fassung dieses Beispiels. Eine Anfrage nennt jede Datei, die sie verwendet, nie ihren Inhalt; der Aufruf trägt die Anfrage und die Dateien zusammen. Eine Schrift, die der Server bereits vorhält, etwa DejaVuSans, wird ohne Anhang genannt. Senden Sie die Anfrage an die Adresse, die die API-Seite angibt.

Wofür dieses Beispiel da ist

QR ist der Code, den die meisten Dokumente am Ende wollen: eine Zahlung auf einer Rechnung, eine Bordkarte, ein Link zu einer Akte, eine Seriennummer auf einem Etikett. Er ist auch der, der am häufigsten von irgendeiner Website geholt, als Bild heruntergeladen und eingefügt wird — was funktioniert bis zu dem Tag, an dem das Bild skaliert wird und der Code nicht mehr lesbar ist.

Was dieses Beispiel zeigt

  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
{
  "metadata": {
    "title": "QR codes, drawn as squares"
  },
  "items": [
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 794, "urx": 523.276, "ury": 813.2},
      "content": [
        "QR codes, drawn as squares"
      ],
      "font": "DejaVuSans",
      "font_size": 16
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 770, "urx": 523.276, "ury": 782.6},
      "content": [
        "A QR code holds a link or a reference that a telephone reads in one shot. It is"
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 755, "urx": 523.276, "ury": 767.6},
      "content": [
        "drawn square by square here, so it stays readable at any size it is printed at."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "qr",
      "content": "https://example.test/invoice/FR-1964413",
      "rect": {"llx": 72, "lly": 628, "urx": 183, "ury": 739}
    },
    {
      "type": "text",
      "rect": {"llx": 84, "lly": 560, "urx": 284, "ury": 636},
      "content": ["https://example.test/invoice/FR-1964413"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "qr",
      "content": "REF 2026-07-16/ACME",
      "rect": {"llx": 283.6875, "lly": 628, "urx": 382.6875, "ury": 727}
    },
    {
      "type": "text",
      "rect": {"llx": 295.6875, "lly": 560, "urx": 495.6875, "ury": 636},
      "content": ["REF 2026-07-16/ACME"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "qr",
      "content": "a-Z 0..9 +*#% and on",
      "rect": {"llx": 421.648438, "lly": 628, "urx": 520.648438, "ury": 727}
    },
    {
      "type": "text",
      "rect": {"llx": 433.648438, "lly": 560, "urx": 570, "ury": 636},
      "content": ["a-Z 0..9 +*#% and on"],
      "font": "DejaVuSans",
      "font_size": 8,
      "leading": 8
    },
    {
      "type": "qr",
      "content": "20260716",
      "mode": "numeric",
      "rect": {
        "llx": 72,
        "lly": 488,
        "urx": 159,
        "ury": 575
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 84.0,
        "lly": 472.0,
        "urx": 679.276,
        "ury": 488.0
      },
      "content": "20260716",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "qr",
      "content": "HQF-2026-0917",
      "correction": "high",
      "rect": {
        "llx": 183,
        "lly": 488,
        "urx": 282,
        "ury": 587
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 195.0,
        "lly": 472.0,
        "urx": 790.276,
        "ury": 488.0
      },
      "content": "HQF-2026-0917",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "qr",
      "content": "HQF BYTES 2026",
      "rect": {
        "llx": 306,
        "lly": 488,
        "urx": 393,
        "ury": 575
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 318.0,
        "lly": 472.0,
        "urx": 913.276,
        "ury": 488.0
      },
      "content": "HQF BYTES 2026",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "qr",
      "content": "LOT 4472",
      "correction": "quartile",
      "rect": {
        "llx": 72,
        "lly": 348,
        "urx": 159,
        "ury": 435
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 84.0,
        "lly": 332.0,
        "urx": 679.276,
        "ury": 348.0
      },
      "content": "LOT 4472",
      "font": "DejaVuSans",
      "font_size": 8,
      "first_baseline": {
        "points": 0
      }
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 310, "urx": 523.276, "ury": 322.6},
      "content": [
        "The last code holds 230 dark modules out of 441."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    }
  ]
}