write_added_to.json

The JSON file of the “An agreement received and added to without a byte moved” example. A maintenance agreement somebody else sent, with a signature area, a date and a line of one's own laid over its last page and an annex added after it, every byte of the agreement left where it was.

JSON 85 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 makes 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 supplier sends a maintenance agreement as a PDF of two pages. It has to go back with a signature area, the date, a line saying who signs, and an annex of one page at the end. Opening the agreement and writing it out again would give back a different file: a signature it already carried would no longer hold, and nobody could prove the wording is still the one that was sent.

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
{
  "supplied_pdfs": { "add_to": { "pdf": "agreement.pdf", "over": [2] } },
  "items": [
    {
      "type": "rect",
      "rect": { "llx": 320.0, "lly": 120.0, "urx": 539.0, "ury": 210.0 },
      "fill": [0.93, 0.96, 1.0],
      "stroke": { "width": 1.0, "color": [0.2, 0.35, 0.7] },
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": { "llx": 328.0, "lly": 180.0, "urx": 539.0, "ury": 196.0 },
      "content": "Signature",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "first_baseline": { "points": 0.0 },
      "color": [0.2, 0.35, 0.7],
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": { "llx": 320.0, "lly": 88.0, "urx": 539.0, "ury": 104.0 },
      "content": "Received on 2026-09-12",
      "font": "DejaVuSans",
      "font_size": 9.0,
      "first_baseline": { "points": 0.0 },
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 220.0, "urx": 539.0, "ury": 240.0 },
      "content": "Read and approved, subject to annex A.",
      "font": "DejaVuSans",
      "font_size": 11.0,
      "first_baseline": { "points": 0.0 },
      "pages": [1]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 750.0, "urx": 539.0, "ury": 770.0 },
      "content": "Annex A",
      "font": "DejaVuSans",
      "font_size": 18.0,
      "first_baseline": { "points": 0.0 },
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 710.0, "urx": 539.0, "ury": 730.0 },
      "content": "The lift in the north wing is serviced every month, not every quarter.",
      "font": "DejaVuSans",
      "font_size": 11.0,
      "first_baseline": { "points": 0.0 },
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 692.0, "urx": 539.0, "ury": 712.0 },
      "content": "This page, the signature area, the date and the line above it were",
      "font": "DejaVuSans",
      "font_size": 11.0,
      "first_baseline": { "points": 0.0 },
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 674.0, "urx": 539.0, "ury": 694.0 },
      "content": "added after the agreement arrived. The first 13 625 bytes of this file",
      "font": "DejaVuSans",
      "font_size": 11.0,
      "first_baseline": { "points": 0.0 },
      "pages": [2]
    },
    {
      "type": "flow",
      "rect": { "llx": 56.0, "lly": 656.0, "urx": 539.0, "ury": 676.0 },
      "content": "are the agreement exactly as it was sent.",
      "font": "DejaVuSans",
      "font_size": 11.0,
      "first_baseline": { "points": 0.0 },
      "pages": [2]
    }
  ]
}