write_pdfa3a.json

Die JSON-Datei des Beispiels „Ein getaggtes Preisverzeichnis in PDF/A-3a“. Ein Preisverzeichnis, dem eine Vorlesesoftware folgt und das ein Programm aus der angehängten Tabelle liest: der dritte Teil der Archivnorm auf seiner höchsten Stufe.

JSON 92 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: schedule. 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

Ein Preisverzeichnis lesen Kunden, manche mit Vorlesesoftware, und das Abrechnungssystem, das es anwendet. Wer es zweimal schreibt – eine Seite für Menschen, eine Datei für das System –, bekommt am Ende zwei verschiedene Preise.

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
{
  "archive": "pdfa3a",
  "metadata": {
    "title": "Schedule of charges, second half of 2026",
    "author": "HQF Development",
    "subject": "A record that says what it is made of and carries the table behind it",
    "producer": "hqf-pdf-server",
    "created": "2026-06-08T09:20:00+02:00"
  },
  "attachments": [
    {
      "name": "schedule",
      "file_name": "schedule.csv",
      "media_type": "text/csv",
      "relationship": "data",
      "description": "The charges this page states, as a machine reads them",
      "modified": "2026-06-08T09:15:00+02:00"
    }
  ],
  "structure": {
    "lang": "en-GB",
    "children": [
      {
        "tag": "Document",
        "children": [
          {
            "tag": "Sect",
            "children": [
              {"tag": "H1", "content": "heading"},
              {"tag": "P", "content": "body"},
              {"tag": "P", "content": "charges"}
            ]
          }
        ]
      }
    ]
  },
  "items": [
    {
      "type": "flow",
      "rect": {"llx": 72, "lly": 750, "urx": 523, "ury": 782},
      "content": "Schedule of charges, second half of 2026",
      "font": "DejaVuSans",
      "font_size": 20,
      "first_baseline": {"points": 0},
      "tag": "H1",
      "mark": "heading",
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": {"llx": 72, "lly": 610, "urx": 523, "ury": 730},
      "content": "This schedule claims the third part of the archival standard at its highest level. It may carry a file of any kind, and it says what it is made of: this line is a heading, the block below is a paragraph, and the rule across the foot is furniture that says nothing at all.\nSomething reading the schedule aloud follows the order the tree gives rather than the order the ink was laid down in, and the table behind the page travels inside the file for a program to take whole.",
      "font": "DejaVuSans",
      "font_size": 11,
      "leading": 16,
      "first_baseline": {"points": 0},
      "tag": "P",
      "mark": "body",
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": {"llx": 72, "lly": 540, "urx": 523, "ury": 596},
      "content": "Carriage stands at 12.40 the consignment, handling at 1.85 the parcel, and storage at 0.40 the day. A charge takes effect on the day the consignment is accepted.",
      "font": "DejaVuSans",
      "font_size": 11,
      "leading": 16,
      "first_baseline": {"points": 0},
      "tag": "P",
      "mark": "charges",
      "pages": [1]
    },
    {
      "type": "rect",
      "rect": {"llx": 72, "lly": 70, "urx": 523, "ury": 71},
      "fill": [0, 0, 0],
      "artifact": "footer",
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": {"llx": 72, "lly": 56, "urx": 523, "ury": 68},
      "content": "Page 1 of 1",
      "font": "DejaVuSans",
      "font_size": 9,
      "first_baseline": {"points": 0},
      "artifact": "footer",
      "pages": [1]
    }
  ]
}