A story that carries on further in

Two stories over two pages: each one begins in a column of the front page and carries on in a column of the second, and the two swap sides on the way. The file says which column follows which, so the reader goes on reading the story it is on.

This page is the whole program, for whoever writes your software. There is nothing here to read otherwise. Go back to the document it writes.

JSON write_articles.json 288 lines

This one is not a program. It is the request the document server is sent: the same page, asked for over the network by an application that writes no PDF code at all.

The library breaks each story once, to the width of one column, then hands the first patch as many of the broken lines as it has room for and the second patch the rest. A request has no block of words that runs from the foot of one patch into the head of the next, so each story travels as two blocks, each already holding the words its patch was handed. The lines fall in the same places, because a line is broken against the room in front of it, and the block that stops in the middle of its story says so, for its last line to be spaced out like the ones above it. The reading order itself is asked for the same way on both sides: two stories, each naming the two patches it is read through.

  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
{
  "items": [
    {
      "type": "text",
      "rect": {
        "llx": 70.0,
        "lly": 780.0,
        "urx": 525.0,
        "ury": 806.4
      },
      "content": [
        "The Thursday Sheet"
      ],
      "font": "DejaVuSans",
      "font_size": 22.0,
      "pages": [1]
    },
    {
      "type": "text",
      "rect": {
        "llx": 70.0,
        "lly": 762.0,
        "urx": 525.0,
        "ury": 772.8
      },
      "content": [
        "Two stories, four columns, and a reading order of their own."
      ],
      "font": "DejaVuSans",
      "font_size": 9.0,
      "pages": [1]
    },
    {
      "type": "line",
      "from": {
        "x": 70.0,
        "y": 752.0
      },
      "to": {
        "x": 525.0,
        "y": 752.0
      },
      "stroke": {
        "width": 1.0
      },
      "pages": [1]
    },
    {
      "type": "rect",
      "rect": {
        "llx": 70.0,
        "lly": 510.0,
        "urx": 285.0,
        "ury": 700.0
      },
      "stroke": {
        "width": 0.5,
        "color": [
          0.75,
          0.75,
          0.75
        ]
      },
      "pages": [1]
    },
    {
      "type": "text",
      "rect": {
        "llx": 76.0,
        "lly": 684.0,
        "urx": 560.0,
        "ury": 698.4
      },
      "content": [
        "The bridge reopens"
      ],
      "font": "DejaVuSans",
      "font_size": 12.0,
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": {
        "llx": 76.0,
        "lly": 510.0,
        "urx": 279.0,
        "ury": 674.0
      },
      "content": "The bridge reopened on Tuesday, eleven months after the river took the middle of it. The county surveyor walked the deck at dawn and declared it sound, which is the only ceremony anyone asked for. Traffic crossed within the hour. What took the eleven months was not the deck but the two piers under it, each rebuilt from the bed up while the water ran round them. The contractor counted nineteen days lost to the weather and none at all to the design, which is a rarer thing than it sounds. The old approach road stays shut until the spring, so",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "align": "justify",
      "leading": 12.5,
      "last_align": "justify",
      "pages": [1]
    },
    {
      "type": "rect",
      "rect": {
        "llx": 310.0,
        "lly": 510.0,
        "urx": 525.0,
        "ury": 700.0
      },
      "stroke": {
        "width": 0.5,
        "color": [
          0.75,
          0.75,
          0.75
        ]
      },
      "pages": [1]
    },
    {
      "type": "text",
      "rect": {
        "llx": 316.0,
        "lly": 684.0,
        "urx": 560.0,
        "ury": 698.4
      },
      "content": [
        "The harvest, county by county"
      ],
      "font": "DejaVuSans",
      "font_size": 12.0,
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": {
        "llx": 316.0,
        "lly": 510.0,
        "urx": 519.0,
        "ury": 674.0
      },
      "content": "The wheat came in ten days early and heavier than anyone had allowed for, and the barns of three parishes were full before the second week of August. The dry June is what did it, say the growers, and the wet April before that. Not every field agrees: the high ground east of the ridge lost a third of what it stood to a wind that came through on a single afternoon. The merchants have held their price so far, which nobody expects to last past the sales, and the millers are already asking what the winter sowing will look like on ground this hard.",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "align": "justify",
      "leading": 12.5,
      "last_align": "justify",
      "pages": [1]
    },
    {
      "type": "rect",
      "rect": {
        "llx": 310.0,
        "lly": 570.0,
        "urx": 525.0,
        "ury": 760.0
      },
      "stroke": {
        "width": 0.5,
        "color": [
          0.75,
          0.75,
          0.75
        ]
      },
      "pages": [2]
    },
    {
      "type": "text",
      "rect": {
        "llx": 316.0,
        "lly": 744.0,
        "urx": 560.0,
        "ury": 758.4
      },
      "content": [
        "The bridge reopens (continued)"
      ],
      "font": "DejaVuSans",
      "font_size": 12.0,
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": {
        "llx": 316.0,
        "lly": 570.0,
        "urx": 519.0,
        "ury": 734.0
      },
      "content": "the lorries still go the long way round by the mill. The parish council has asked for a footway on the upstream side and been told it will wait its turn. Meanwhile the bus takes four minutes off its run and the school on the far bank has moved its bell back to where it stood before the flood. Nobody has yet said what becomes of the temporary crossing downstream, which cost more to keep open than to build and which the anglers would like left where it is.",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "align": "justify",
      "leading": 12.5,
      "pages": [2]
    },
    {
      "type": "rect",
      "rect": {
        "llx": 70.0,
        "lly": 570.0,
        "urx": 285.0,
        "ury": 760.0
      },
      "stroke": {
        "width": 0.5,
        "color": [
          0.75,
          0.75,
          0.75
        ]
      },
      "pages": [2]
    },
    {
      "type": "text",
      "rect": {
        "llx": 76.0,
        "lly": 744.0,
        "urx": 560.0,
        "ury": 758.4
      },
      "content": [
        "The harvest, county by county (continued)"
      ],
      "font": "DejaVuSans",
      "font_size": 12.0,
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": {
        "llx": 76.0,
        "lly": 570.0,
        "urx": 279.0,
        "ury": 734.0
      },
      "content": "The straw is the other half of the story: there is a great deal of it, it is dry, and the men who bale it have been working the fields two counties away as well as their own. Two of the larger farms have put their second cut off a fortnight in the hope of rain. The weighbridge at the co-operative has been open since six every morning and the queue at seven is longer than it was last year at nine.",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "align": "justify",
      "leading": 12.5,
      "pages": [2]
    }
  ],
  "articles": [
    {
      "title": "The bridge reopens",
      "author": "Claire Vasseur",
      "patches": [
        {
          "page": 1,
          "x": 70.0,
          "y": 510.0,
          "width": 215.0,
          "height": 190.0
        },
        {
          "page": 2,
          "x": 310.0,
          "y": 570.0,
          "width": 215.0,
          "height": 190.0
        }
      ]
    },
    {
      "title": "The harvest, county by county",
      "author": "Martin Aubert",
      "patches": [
        {
          "page": 1,
          "x": 310.0,
          "y": 510.0,
          "width": 215.0,
          "height": 190.0
        },
        {
          "page": 2,
          "x": 70.0,
          "y": 570.0,
          "width": 215.0,
          "height": 190.0
        }
      ]
    }
  ],
  "metadata": {
    "title": "The Thursday Sheet"
  }
}