liveBook · Manning

Page content

As explained in How Computers Make Books

Page content is the sequence of PDF operators, numbers, and strings that describes what appears on a page.

A PDF page is described by a sequence of numbers, strings, and operators. Together, they say where to move, when text begins, which font to use, what text to draw, and when text ends. section 11.4

Listing 11.1 Adding some text
1 0 0 1 20 150 cm   #A
BT 
  F0 36 Tf   #B
  (Hello, World!) Tj #C
ET

A small listing makes the sequence tangible: cm positions the text, BT and ET bracket it, Tf selects a font, and Tj draws “Hello, World!”. section 11.4

The same language can describe more than text:

  • Vector commands draw an underline that scales smoothly for different viewer sizes and print resolutions. section 11.4
  • Image commands display a tiny 5-by-5-pixel grayscale gradient, enlarged by 100 times. section 11.4
  • A q/Q pair saves and restores the graphics position, keeping later operations independent of earlier ones. section 11.4

A line beneath text

After the text commands, m moves to a starting point, l draws to an endpoint, and S strokes the line. Two segments handle the comma’s dip below the baseline. section 11.4

How How Computers Make Books covers it

How deep it goes
Demonstrates text, vector, and image operators with small listings, but leaves matrix mathematics beyond scope.
Examples
Uses “Hello, World!”, underlining commands, and a scaled 5-by-5-pixel grayscale image.
What you can do after
Build it from scratch using PDF operators for positioning, text, lines, graphics state, and images.
How it connects
Connects PDF operators with text drawing, vector graphics, pixel-based images, and page structure.

This explainer was generated by Manning's knowledge graph from the text of How Computers Make Books. The section links point to the parts of the book it draws on.