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
