write_lists.json

Die JSON-Datei des Beispiels „Listen aus einem Einzug und einem Tabstopp“. Aufzählungen, nummerierte und verschachtelte Listen, jede aus einem nach links hängenden Einzug und einem Tabstopp gebaut statt aus einem eigenen Listenobjekt: Das Zeichen sitzt in dem Raum, den der Einzug öffnet, und jede Zeile unter der ersten beginnt dort, wo der Tabulator den Text hingesetzt hat.

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

Das Erkennungszeichen eines von einem Programm zusammengesetzten Dokuments ist eine Liste, deren zweite Zeile unter dem Aufzählungszeichen beginnt statt unter den Wörtern. Es ist eine Kleinigkeit, und jede Textverarbeitung der Welt macht es richtig.

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
{
  "items": [
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 760.8,
        "urx": 280.0,
        "ury": 780.0
      },
      "content": "Bulleted: a bullet, a tabulation, and 14 points in front of the body.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 672.8,
        "urx": 280.0,
        "ury": 756.8
      },
      "content": "•\tEvery line below the first lines up with the words, not with the bullet.\n•\tThe marker hangs in the room the negative first-line indent opens.\n•\tA long item wraps inside the block and stays inside it.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 14.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 320.0,
        "lly": 760.8,
        "urx": 530.0,
        "ury": 780.0
      },
      "content": "Numbered: the same block, widened to 22 points for the widest marker.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 320.0,
        "lly": 658.8,
        "urx": 530.0,
        "ury": 756.8
      },
      "content": "1.\tA number hangs out to the left exactly as a bullet does.\n2.\tThe room in front is what the widest marker needs, not the narrowest.\n10.\tA two-figure number still ends before the stop the body begins at.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 630.4,
        "urx": 530.0,
        "ury": 640.0
      },
      "content": "Nested: the inner list is the same block again, its markers standing where the outer bodies begin.",
      "font": "DejaVuSans",
      "font_size": 8.0
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 612.4,
        "urx": 530.0,
        "ury": 626.4
      },
      "content": "1.\tPrepare the document, the font it draws through and the page it fills.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 584.4,
        "urx": 530.0,
        "ury": 612.4
      },
      "content": "a.\tRead the font from its file and hand it to the document.\nb.\tName the page size, in points.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 22.0,
        "body": 44.0
      }
    },
    {
      "type": "flow",
      "rect": {
        "llx": 70.0,
        "lly": 570.4,
        "urx": 530.0,
        "ury": 584.4
      },
      "content": "2.\tAdd each page, with the content stream it was built from.",
      "font": "DejaVuSans",
      "font_size": 10.5,
      "leading": 14.0,
      "hanging_list": {
        "marker": 0.0,
        "body": 22.0
      }
    }
  ]
}