write_barcodes.json

The JSON file of the “Every Linear Barcode on One Page” example. Nine barcodes from the workshop, the warehouse, the till, the blood bank and the book trade, each printed above the text a scanner reads back from it.

JSON 182 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 creates 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 workshop, a warehouse and a till do not read the same stripes. The label on a storage bay is Code 39, the outer case a shop takes delivery of is ITF-14, a blood bag is Codabar, a magazine carries its issue number in a small block beside its main code. A label printed in the wrong family is a label the scanner at the far end does not read at all, and somebody types the number in by hand.

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
{
  "metadata": {
    "title": "The linear barcodes a request can ask for by name"
  },
  "items": [
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 794, "urx": 523.276, "ury": 813.2},
      "content": [
        "The barcodes a workshop, a warehouse and a till read"
      ],
      "font": "DejaVuSans",
      "font_size": 16
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 770, "urx": 523.276, "ury": 782.6},
      "content": [
        "Each box below is one module to the point, so every bar edge lands on a whole"
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 755, "urx": 523.276, "ury": 767.6},
      "content": [
        "pixel of a printer. Under each code is what a scanner reads back from it."
      ],
      "font": "DejaVuSans",
      "font_size": 10.5
    },
    {
      "type": "barcode",
      "symbology": "code39",
      "content": "BAY 12-A",
      "rect": {"llx": 72, "lly": 690, "urx": 251, "ury": 730}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 672, "urx": 523.276, "ury": 684},
      "content": [
        "Code 39, the workshop label: BAY 12-A"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "code39",
      "content": "159",
      "check_digit": true,
      "rect": {"llx": 72, "lly": 618, "urx": 187, "ury": 658}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 600, "urx": 523.276, "ury": 612},
      "content": [
        "Code 39 carrying its modulo 43 check character: 159F"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "code93",
      "content": "BAY 12-A",
      "rect": {"llx": 72, "lly": 546, "urx": 201, "ury": 586}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 528, "urx": 523.276, "ury": 540},
      "content": [
        "Code 93, the same text in half the room: BAY 12-A"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "itf14",
      "content": "00012345678905",
      "rect": {"llx": 72, "lly": 474, "urx": 227, "ury": 514}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 456, "urx": 523.276, "ury": 468},
      "content": [
        "ITF-14, the outer case a shop takes delivery of: 00012345678905"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "codabar",
      "content": "A31600$D",
      "rect": {"llx": 72, "lly": 402, "urx": 191, "ury": 442}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 384, "urx": 523.276, "ury": 396},
      "content": [
        "Codabar, the blood bag and the borrower's card: A31600$D"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "upc_e",
      "content": "01234565",
      "rect": {"llx": 72, "lly": 330, "urx": 143, "ury": 370}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 312, "urx": 523.276, "ury": 324},
      "content": [
        "UPC-E, the small North American package: 01234565"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "ean13",
      "content": "9780201379624",
      "rect": {"llx": 72, "lly": 258, "urx": 187, "ury": 298}
    },
    {
      "type": "barcode",
      "symbology": "add_on2",
      "content": "53",
      "rect": {"llx": 176, "lly": 258, "urx": 216, "ury": 298}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 240, "urx": 523.276, "ury": 252},
      "content": [
        "A magazine, its issue number in a two-digit add-on: 9780201379624 53"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "ean13",
      "content": "9781234567897",
      "rect": {"llx": 72, "lly": 186, "urx": 187, "ury": 226}
    },
    {
      "type": "barcode",
      "symbology": "add_on5",
      "content": "51999",
      "rect": {"llx": 176, "lly": 186, "urx": 243, "ury": 226}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 168, "urx": 523.276, "ury": 180},
      "content": [
        "A book, the price its publisher suggests in a five-digit add-on: 9781234567897 51999"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    },
    {
      "type": "barcode",
      "symbology": "data_bar",
      "content": "00012345678905",
      "rect": {"llx": 72, "lly": 114, "urx": 188, "ury": 154}
    },
    {
      "type": "text",
      "rect": {"llx": 72, "lly": 96, "urx": 523.276, "ury": 108},
      "content": [
        "GS1 DataBar, the loose cut of meat and the small pack: 00012345678905"
      ],
      "font": "DejaVuSans",
      "font_size": 9
    }
  ]
}