write_carried_facts.json

The JSON file of the “A delivery note that knows its own order” example. Every line of the note carries the order it was picked for, the article code and the shelf it came off, and prints none of them. The place where the driver signs carries the round and the van, and one beside the fold tick carries nothing but its own place.

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

A warehouse prints a note for the driver and keeps a record for itself. Three days later the signed sheet comes back, and somebody has to put it beside the record it belongs to. Printing the codes on the note would settle that in a moment, at the price of a column of machine words down a sheet a customer reads and signs.

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
{
  "carried_facts": [
    { "name": "line 1", "facts": { "Article": "TBL-OAK-180", "Bin": "A-14-3", "Order": "SO-88412" } },
    { "name": "line 2", "facts": { "Article": "CHR-WAL-04", "Bin": "A-09-1", "Order": "SO-88412" } },
    { "name": "line 3", "facts": { "Article": "SBD-3DR-120", "Bin": "B-02-7", "Order": "SO-88451" } },
    { "name": "line 4", "facts": { "Article": "SHF-WAL-090", "Bin": "C-31-2", "Order": "SO-88451" } },
    { "name": "line 5", "facts": { "Article": "CST-STD-01", "Bin": "C-08-5", "Order": "SO-88463" } },
    { "name": "line 6", "facts": { "Article": "LMP-FLR-BRS", "Bin": "D-17-9", "Order": "SO-88463" } },
    { "name": "round", "facts": { "Round": "RT-2026-224", "Van": "DRV-118" } }
  ],
  "items": [
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 746.8, "urx": 523.0, "ury": 790.0 },
      "content": "A delivery note that knows which order it came from",
      "font": "DejaVuSans",
      "font_size": 18.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 674.8, "urx": 523.0, "ury": 734.8 },
      "content": "Every line of the note below carries the order it was picked for, the article code and the shelf it came off, and prints none of the three. The line is drawn inside a marked run, and the run points at a list of facts held once in the file under the warehouse's own names. The sheet that comes back signed is therefore paired with the records it came from by reading the file, not by reading the paper.",
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 638.4, "urx": 523.0, "ury": 652.8 },
      "content": "The note the driver carries",
      "font": "DejaVuSans",
      "font_size": 12.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 618.2, "urx": 523.0, "ury": 628.4 },
      "content": "Meunier & Filles, 14 rue des Tanneurs, Tours — delivered 13 August 2026",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "color": [0.42, 0.42, 0.42]
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 596.0, "urx": 372.0, "ury": 606.2 },
      "content": "Goods",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "color": [0.42, 0.42, 0.42]
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 596.0, "urx": 422.0, "ury": 606.2 },
      "content": "Qty",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "align": "right",
      "color": [0.42, 0.42, 0.42]
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 596.0, "urx": 523.0, "ury": 606.2 },
      "content": "Picked by",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "align": "right",
      "color": [0.42, 0.42, 0.42]
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 592.0 },
      "to": { "x": 523.0, "y": 592.0 },
      "stroke": { "width": 0.6, "color": [0.3, 0.3, 0.3] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 568.6, "urx": 372.0, "ury": 580.0 },
      "content": "Oak dining table, 180 cm",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 1"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 568.6, "urx": 422.0, "ury": 580.0 },
      "content": "1",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 1"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 568.6, "urx": 523.0, "ury": 580.0 },
      "content": "MJ",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 1"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 566.0 },
      "to": { "x": 523.0, "y": 566.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 550.6, "urx": 372.0, "ury": 562.0 },
      "content": "Dining chair, walnut",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 2"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 550.6, "urx": 422.0, "ury": 562.0 },
      "content": "6",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 2"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 550.6, "urx": 523.0, "ury": 562.0 },
      "content": "MJ",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 2"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 548.0 },
      "to": { "x": 523.0, "y": 548.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 532.6, "urx": 372.0, "ury": 544.0 },
      "content": "Sideboard, three doors",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 3"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 532.6, "urx": 422.0, "ury": 544.0 },
      "content": "1",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 3"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 532.6, "urx": 523.0, "ury": 544.0 },
      "content": "PL",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 3"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 530.0 },
      "to": { "x": 523.0, "y": 530.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 514.6, "urx": 372.0, "ury": 526.0 },
      "content": "Wall shelf, 90 cm",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 4"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 514.6, "urx": 422.0, "ury": 526.0 },
      "content": "4",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 4"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 514.6, "urx": 523.0, "ury": 526.0 },
      "content": "PL",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 4"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 512.0 },
      "to": { "x": 523.0, "y": 512.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 496.6, "urx": 372.0, "ury": 508.0 },
      "content": "Coat stand",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 5"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 496.6, "urx": 422.0, "ury": 508.0 },
      "content": "2",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 5"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 496.6, "urx": 523.0, "ury": 508.0 },
      "content": "SD",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 5"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 494.0 },
      "to": { "x": 523.0, "y": 494.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 478.6, "urx": 372.0, "ury": 490.0 },
      "content": "Floor lamp, brushed steel",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "tag": "Line",
      "facts": "line 6"
    },
    {
      "type": "flow",
      "rect": { "llx": 372.0, "lly": 478.6, "urx": 422.0, "ury": 490.0 },
      "content": "3",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 6"
    },
    {
      "type": "flow",
      "rect": { "llx": 422.0, "lly": 478.6, "urx": 523.0, "ury": 490.0 },
      "content": "SD",
      "font": "DejaVuSans",
      "font_size": 9.5,
      "align": "right",
      "tag": "Line",
      "facts": "line 6"
    },
    {
      "type": "line",
      "from": { "x": 72.0, "y": 476.0 },
      "to": { "x": 523.0, "y": 476.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "line",
      "from": { "x": 323.0, "y": 456.0 },
      "to": { "x": 523.0, "y": 456.0 },
      "stroke": { "width": 0.5, "color": [0.3, 0.3, 0.3] },
      "tag": "Signature",
      "facts": "round"
    },
    {
      "type": "flow",
      "rect": { "llx": 323.0, "lly": 442.8, "urx": 523.0, "ury": 453.0 },
      "content": "Signed on delivery",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "align": "right",
      "color": [0.42, 0.42, 0.42]
    },
    {
      "type": "line",
      "from": { "x": 54.0, "y": 561.0 },
      "to": { "x": 64.0, "y": 561.0 },
      "stroke": { "width": 0.4, "color": [0.72, 0.72, 0.72] }
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 402.4, "urx": 523.0, "ury": 416.8 },
      "content": "What travels under the page",
      "font": "DejaVuSans",
      "font_size": 12.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 344.4, "urx": 523.0, "ury": 392.4 },
      "content": "Seven lists of facts travel with this sheet: one against each of the six lines, and one at the point where the driver signs, which carries the round and the van. Not one letter of any of them is drawn. A list is written once in the file and pointed at from the page, so a list that belongs to several places is held once and marked as often as it is needed.",
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 312.0, "urx": 523.0, "ury": 326.4 },
      "content": "The mark that carries nothing",
      "font": "DejaVuSans",
      "font_size": 12.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 266.0, "urx": 523.0, "ury": 302.0 },
      "content": "The short stroke in the left margin is where the sheet is folded for a window envelope, and a mark of its own is put in the page beside it, under a name and with no facts at all. A place is sometimes all there is to say.",
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "flow",
      "rect": { "llx": 72.0, "lly": 213.6, "urx": 523.0, "ury": 246.0 },
      "content": "What a list holds is the caller's business: an order number here, an article code in a catalogue, a state against a box on a form. The library neither reads these names nor acts on them — it writes them down and ties them to what was drawn.",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "color": [0.42, 0.42, 0.42]
    }
  ]
}