Fonts kept inside the file

Text set in a font the file carries inside it, cut down to the letters actually used.

JSON write_text.json 34 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.

 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
{
  "metadata": {
    "title": "hqf-pdf text sample"
  },
  "items": [
    {
      "type": "text",
      "rect": {
        "llx": 60,
        "lly": 600,
        "urx": 560,
        "ury": 788.0
      },
      "content": [
        "Invoice No. 1964413 \u2014 HQF Development, Cabri\u00e8s\nIssued 14 July 2026 \u2014 due within 30 days\nRendering engine development ............... 4 250.00 EUR\nVAT at 20 % .................................. 850.00 EUR\nTotal due .................................. 5 100.00 EUR"
      ],
      "font": "DejaVuSans",
      "font_size": 14.0,
      "leading": 28.0
    },
    {
      "type": "rect",
      "rect": {
        "llx": 60,
        "lly": 620,
        "urx": 381.719727,
        "ury": 620
      },
      "stroke": {
        "width": 0.8
      }
    }
  ]
}