PDF objects and references: what does 3 0 R mean?
By Anton Samper · Reviewed
3 0 R is an indirect reference to PDF object number 3, generation 0. The generation number distinguishes versions of a reused object number. The letter R marks a reference: look up that object to read its value. An indirect object has its own number and can be referenced from elsewhere in the PDF.
Follow a page to its drawing instructions
The original A simple page sample contains five indirect objects. Object 1 is the document catalogue, object 2 is the page-tree root, object 3 is a page, object 4 holds drawing instructions, and object 5 is a Helvetica font resource.
Explore A simple pageDownload sample PDF
3 0 obj
<< /Type /Page
/Parent 2 0 R
/MediaBox [0 0 612 792]
/Contents 4 0 R >>
endobjHere /Parent 2 0 R points to the page’s parent in the page tree. /Contents 4 0 R points to its content stream. /MediaBox is an array written directly in the page dictionary (a collection of key–value pairs). Its four numbers give the lower-left and upper-right corners of the page boundary in PDF user-space units.
- Open the sample and select First page.
- Inspect its Properties, then click 4 0 R beside
/Contents. - Switch to Decoded to read the instructions, or Source to inspect the object representation.
- Use Back to return to the page. Follow 2 0 R to see its parent and inherited resources.
When to use Properties or Original bytes
The example above adds line breaks for readability. Properties shows how the parser interprets each value. It may change the order of dictionary entries, keep only one value for duplicate keys, or display strings differently from how they were written. Use Original bytes to check the exact syntax stored in the file. An array of more than 1,000 items shows its first 1,000; load more from the start, or jump to the last items the inspector kept, such as the final stream in a long page /Contents list.
To locate an object stored inside a compressed object stream, first decode its containing stream. The object’s offset is its position in those decoded bytes; it has no separate offset in the original file. The inspector labels recovered or unavailable source locations. A reference to an unavailable object does not prove that the object never existed.
Continue exploring
Learn about raw and decoded streams, or follow the page’s font and image resources.
Example source: original sample generator, baseObjects and minimalPdf. This walkthrough covers the bundled sample. It does not establish support for every PDF allowed by the specification.