PDF preserves a multipage document’s appearance while it travels from one computer, printer, or reader to another. A page can combine glyphs from fonts, pixel-based images, and line drawings; together, those ingredients can make a book page. PDF can also carry metadata, such as an interactive table of contents. section 11.3 section 11.6
Think of a PDF page as a small set of drawing instructions. Its content stream contains numbers, strings, and operators: commands can position text, choose a font and size, draw text, trace lines, and place an image. Around that stream sits file structure describing pages, resources, and the document catalog. section 11.4
A simple page can be assembled in stages:
- Position text, begin a text section, select a font, draw the characters, and end the text section. section 11.4
- Add vector lines after the text; unlike pixels, these lines scale smoothly for viewing or printing. section 11.4
- Place a small pixel image by defining its width, height, gray color space, bit depth, and image data, then scale it on the page. section 11.4
- Wrap the page data in numbered objects, then provide a cross-reference table and trailer so a reader can locate them. section 11.4
A tiny “Hello, World!” page
One worked page moves to a position, sets font F0 to 36 points, and draws “Hello, World!”. Two short line segments underline it around the comma. A 5×5 gray gradient is then enlarged 100 times, making the difference between compact image data and its displayed size easy to see. section 11.4
Listing 11.4 Our PDF skeleton
1 0 obj #A
<</Type /Pages /Kids [3 0 R] /Count 1>>
endobj
2 0 obj #B
<</Length 235>>
stream
\textit{(all of our page data from above)}
endstream
endobj
3 0 obj #C
<</Type /Page
/Parent 1 0 R
/Resources
<</Font
<</F0 <</Type /Font /Subtype /Type1 /BaseFont /Times-Italic>>>>
>>
/MediaBox[0 0 300 200]
/Rotate 0
/Contents[2 0 R]
>>
endobj
4 0 obj #D
<</Type /Catalog /Pages 1 0 R>>
endobj
xref
0 5 #E
0000000000 65535 f
0000000015 00000 n
0000000066 00000 n
0000000163 00000 n
0000000348 00000 n
trailer
<</Root 4 0 R /Size 5>>
startxref
393
%%EOF
Inspect the compact file skeleton to see page objects, the content stream, font resources, the catalog, and the cross-reference table together. section 11.4
PDF suits print and electronic publication when a fixed page layout matters. Reflowable eBooks with few graphics may instead use formats designed for eBook devices. section 11.6

