write_portfolio.json

Die JSON-Datei des Beispiels „Ein Ausschreibungspaket mit drei Losen“. Drei Lose, jedes als separate Datei an das Dokument angehängt, beschrieben durch die Spalten, die das Dokument selbst definiert — Los, Versandtag, Betrag —, und neueste zuerst sortiert. Das Deckblatt wiederholt dieselben Spalten offen sichtbar, für Anzeigesoftware, die angehängte Dateien nicht zeigt.

JSON 572 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.

Diese Anfrage nennt Dateien, die sie nicht trägt: lot_a, lot_b, lot_c. Jede davon reist neben der Anfrage, im selben Aufruf, als mitgelieferter Teil, genau so benannt, wie die Anfrage sie hier nennt — die Beschreibung sagt, welcher Name welche Rolle spielt, Sie benennen Ihre Dateien also, wie Sie möchten. Eine Anfrage, die eine Datei nennt, von der der Aufruf nichts trägt, wird abgelehnt.

Wofür dieses Beispiel da ist

Drei Firmen beantworten eine Ausschreibung, und was ankommt, sind drei Zahlenwerke, die getrennt bleiben und zusammen reisen müssen. Jedes Los kommt als eigene Datei in dieses Dokument, vollständig, in der Form, in der es gesendet wurde. Was daraus statt eines Sacks voller Anhänge eine Mappe macht, die jemand durcharbeiten kann, ist der Rest: Das Dokument nennt die Spalten, unter denen die Dateien gezeigt werden — das Los, der Tag des Versands, der Betrag —, sagt, was jede Datei in jede davon einträgt, und sagt, dass die Liste nach dem Tag sortiert ist, neueste zuerst.

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
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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
{
  "items": [
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 780.0,
        "urx": 539.0,
        "ury": 799.2
      },
      "content": [
        "Tender pack: three lots"
      ],
      "font": "DejaVuSans",
      "font_size": 16.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 638.0,
        "urx": 539.0,
        "ury": 750.0
      },
      "content": [
        "Every lot of this tender travels in the pack as a file of its own. The document states the columns the files are shown in, what each file holds for each of them, and that the list is sorted on the day it was sent, newest first."
      ],
      "font": "DejaVuSans",
      "font_size": 10.0,
      "leading": 14.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 676.0,
        "urx": 539.0,
        "ury": 686.8
      },
      "content": [
        "File"
      ],
      "font": "DejaVuSans",
      "font_size": 9.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 152.0,
        "lly": 676.0,
        "urx": 539.0,
        "ury": 686.8
      },
      "content": [
        "Lot"
      ],
      "font": "DejaVuSans",
      "font_size": 9.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 356.0,
        "lly": 676.0,
        "urx": 539.0,
        "ury": 686.8
      },
      "content": [
        "Sent"
      ],
      "font": "DejaVuSans",
      "font_size": 9.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 448.0,
        "lly": 676.0,
        "urx": 539.0,
        "ury": 686.8
      },
      "content": [
        "Total"
      ],
      "font": "DejaVuSans",
      "font_size": 9.0
    },
    {
      "type": "line",
      "from": {
        "x": 56.0,
        "y": 670.0
      },
      "to": {
        "x": 539.0,
        "y": 670.0
      },
      "stroke": {
        "width": 0.5,
        "color": [
          0.75,
          0.75,
          0.75
        ]
      }
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 648.0,
        "urx": 539.0,
        "ury": 660.0
      },
      "content": [
        "lot-a.xml"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 152.0,
        "lly": 648.0,
        "urx": 539.0,
        "ury": 660.0
      },
      "content": [
        "Earthworks and site clearance"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 356.0,
        "lly": 648.0,
        "urx": 539.0,
        "ury": 660.0
      },
      "content": [
        "2026-07-14"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 448.0,
        "lly": 648.0,
        "urx": 539.0,
        "ury": 660.0
      },
      "content": [
        "EUR 18,400.00"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 626.0,
        "urx": 539.0,
        "ury": 638.0
      },
      "content": [
        "lot-b.xml"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 152.0,
        "lly": 626.0,
        "urx": 539.0,
        "ury": 638.0
      },
      "content": [
        "Drainage and services"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 356.0,
        "lly": 626.0,
        "urx": 539.0,
        "ury": 638.0
      },
      "content": [
        "2026-08-03"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 448.0,
        "lly": 626.0,
        "urx": 539.0,
        "ury": 638.0
      },
      "content": [
        "EUR 9,250.00"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 604.0,
        "urx": 539.0,
        "ury": 616.0
      },
      "content": [
        "lot-c.xml"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 152.0,
        "lly": 604.0,
        "urx": 539.0,
        "ury": 616.0
      },
      "content": [
        "Surfacing and lining"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 356.0,
        "lly": 604.0,
        "urx": 539.0,
        "ury": 616.0
      },
      "content": [
        "2026-06-28"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 448.0,
        "lly": 604.0,
        "urx": 539.0,
        "ury": 616.0
      },
      "content": [
        "EUR 31,700.00"
      ],
      "font": "DejaVuSans",
      "font_size": 10.0
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 470.8,
        "urx": 539.0,
        "ury": 566.0
      },
      "content": [
        "A reading software that shows a portfolio lays the three files out in these columns. One that does not still opens the pack and lists the files, which is why they are named on this sheet too."
      ],
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.899999999999999,
      "color": [
        0.35,
        0.35,
        0.35
      ]
    },
    {
      "type": "text",
      "rect": {
        "llx": 56.0,
        "lly": 480.0,
        "urx": 539.0,
        "ury": 513.2
      },
      "content": [
        "What the pack states"
      ],
      "font": "DejaVuSans",
      "font_size": 11.0,
      "color": [
        0.35,
        0.35,
        0.35
      ]
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 471.0,
        "urx": 539.0,
        "ury": 482.0
      },
      "content": "Shown as rows, opening on lot-a.xml, sorted on the column sent, newest first.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 446.0,
        "urx": 539.0,
        "ury": 468.0
      },
      "content": "Columns: Lot (words); Sent (a moment); Total (a number); File (the file name); What it is (what the file is); Changed (when it changed); Size (its size), hidden.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 432.0,
        "urx": 539.0,
        "ury": 443.0
      },
      "content": "Folders: Groundworks (lot-a.xml, lot-b.xml); Surfacing (lot-c.xml).",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 418.0,
        "urx": 539.0,
        "ury": 429.0
      },
      "content": "lot-a.xml: Earthworks and site clearance; application/xml; its source; carried, 179 bytes, changed 2026-07-14.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 404.0,
        "urx": 539.0,
        "ury": 415.0
      },
      "content": "lot-b.xml: Drainage and services; application/xml; its source; carried, 170 bytes, changed 2026-08-03.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 390.0,
        "urx": 539.0,
        "ury": 401.0
      },
      "content": "lot-c.xml: Surfacing and lining; application/xml; its source; carried, 170 bytes, changed 2026-06-28.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 365.0,
        "urx": 539.0,
        "ury": 387.0
      },
      "content": "plans/site-plan.pdf: The site plan, kept beside the pack; no media type; a supplement to it; kept beside the pack at plans/site-plan.pdf.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 56.0,
        "lly": 340.0,
        "urx": 539.0,
        "ury": 362.0
      },
      "content": "https://hqf-pdf.com/examples/tender/ground-survey.csv: The ground survey, served from our site; no media type; its data; served from https://hqf-pdf.com/examples/tender/ground-survey.csv.",
      "font": "DejaVuSans",
      "font_size": 8.5,
      "leading": 11.0
    }
  ],
  "collection": {
    "view": "rows",
    "columns": [
      {
        "key": "lot",
        "title": "Lot",
        "data": "text"
      },
      {
        "key": "sent",
        "title": "Sent",
        "data": "date"
      },
      {
        "key": "total",
        "title": "Total",
        "data": "number"
      },
      {
        "key": "file",
        "title": "File",
        "data": "file_name"
      },
      {
        "key": "what",
        "title": "What it is",
        "data": "description"
      },
      {
        "key": "changed",
        "title": "Changed",
        "data": "modified"
      },
      {
        "key": "size",
        "title": "Size",
        "data": "size",
        "hidden": true
      }
    ],
    "sort": {
      "key": "sent",
      "ascending": false
    },
    "opens_on": "lot-a.xml",
    "folders": {
      "id": 1,
      "name": "Tender pack",
      "children": [
        {
          "id": 2,
          "name": "Groundworks"
        },
        {
          "id": 3,
          "name": "Surfacing"
        }
      ]
    }
  },
  "attachments": [
    {
      "name": "lot_a",
      "file_name": "lot-a.xml",
      "description": "Earthworks and site clearance",
      "media_type": "application/xml",
      "relationship": "source",
      "modified": "2026-07-14T09:30:00+02:00",
      "columns": [
        {
          "key": "lot",
          "text": "Earthworks and site clearance"
        },
        {
          "key": "sent",
          "date": "2026-07-14T09:30:00+02:00"
        },
        {
          "key": "total",
          "number": 18400.0
        }
      ],
      "folder": 2
    },
    {
      "name": "lot_b",
      "file_name": "lot-b.xml",
      "description": "Drainage and services",
      "media_type": "application/xml",
      "relationship": "source",
      "modified": "2026-08-03T16:05:00+02:00",
      "columns": [
        {
          "key": "lot",
          "text": "Drainage and services"
        },
        {
          "key": "sent",
          "date": "2026-08-03T16:05:00+02:00"
        },
        {
          "key": "total",
          "number": 9250.0
        }
      ],
      "folder": 2
    },
    {
      "name": "lot_c",
      "file_name": "lot-c.xml",
      "description": "Surfacing and lining",
      "media_type": "application/xml",
      "relationship": "source",
      "modified": "2026-06-28T11:20:00+02:00",
      "columns": [
        {
          "key": "lot",
          "text": "Surfacing and lining"
        },
        {
          "key": "sent",
          "date": "2026-06-28T11:20:00+02:00"
        },
        {
          "key": "total",
          "number": 31700.0
        }
      ],
      "folder": 3
    }
  ],
  "referenced_files": [
    {
      "name": "site_plan",
      "payload": {
        "beside": "plans/site-plan.pdf"
      },
      "description": "The site plan, kept beside the pack",
      "relationship": "supplement"
    },
    {
      "name": "ground_survey",
      "payload": {
        "at": "https://hqf-pdf.com/examples/tender/ground-survey.csv"
      },
      "description": "The ground survey, served from our site",
      "relationship": "data"
    }
  ],
  "version": "2.0",
  "reading": {
    "open_mode": "attachments"
  }
}