A PDF file is composed of many objects, each identified by a unique object number and generation number. Objects begin with the object number and the keyword obj and end with endobj. Between these keywords, the content of the object is defined.
Key Characteristics of a PDF Dictionary
- Each dictionary starts with << and ends with >>.
- Key-value pairs within the dictionary define specifics of the PDF object.
- Values can be simple data types or complex references to other objects.
- The flexibility allows PDF to describe fonts, pages, annotations, images, forms, and more.
Viewing a PDF Object
If you view a PDF object you will see something like this:
2479 0
obj<<
/LastChar 89
/BaseFont /MXREUX+HelveticaLTStd-Roman
/Type /Font
/Encoding /WinAnsiEncoding
/Subtype /Type1
/FontDescriptor 2480 0 R
/FirstChar 32
/Widths [278 0 0 0 0 0 0 0 0 0 0 0 0 0 278 0 556 556 556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 667 0 722 0 667 0 778 722 278 500 0 556 833 722 778 0 0 722 0 0 722 0 944 0 667]
>>
endobj
2484 0
obj<<
/Subtype /Type1C
/Length 886
/Filter /FlateDecode
>>
stream (rest of object ommitted)
This shows 2 PDF objects (identified as object 2479 0 R and 2484 0 R). The PDF object starts with a number and then obj shows the start of the object. The PDF dictionary is contained between the << >> brackets.
Object 2484 0 R also has some binary data at the end which comes after the word stream. The last part of the object is the word endobj
So lets have a closer look and see what is going on between those brackets. An entry in a PDF Dictionary consists of a pair of values – a key (which always starts with a / ) and a value (which can be many things). So /LastChar, /BaseFont, /Type, /Encoding, etc are all keys which are defined in the PDF file specification.
It is possible to add your own keys which will be ignored by Acrobat. The order they are listed is not important as all keys and their values are read before anything happens with the object.
The type of value depends on the key, so /LastChar takes a number value, /BaseFont, /Type, /Subtype take a string constant value starting with a /, /Widths is a array of numbers and /FontDescriptor points to another object. All values can be stored in another value, so the value can also be an object (2480 0 R) which contains the actual data (number, string,etc).
Use Cases of PDF Dictionaries
PDF dictionaries are fundamental in describing various components in PDF files, enabling rich document features.
Some key use cases include:
- Fonts: Dictionaries define font objects, including type, encoding, widths, and the font descriptor object that stores metrics and font file references.
- Pages and Content Streams: Page dictionaries specify page size, resources (fonts, images), and content streams that represent page contents.
- Annotations and Interactive Forms: Dictionaries detail annotations like links, highlights, and form fields, describing appearance, behavior, and interactivity parameters.
- Images and Color Spaces: Image objects use dictionaries to define image attributes such as width, height, color space, compression filters, and mask information.
- Embedded Files and Metadata: Dictionaries describe embedded attachments and document metadata, enabling file attachments and structured data storage.
- Transparency and Graphics State: Graphic state dictionaries define blending modes, transparency settings, line widths, and other rendering parameters.
The value pairs contain all the data for the PDF objects and now you know how they work.
We’ve been working with PDFs for the last 20 years and can help you learn more about the PDF file format.
Our software libraries allow you to
| Convert PDF files to HTML |
| Use PDF Forms in a web browser |
| Convert PDF Documents to an image |
| Work with PDF Documents in Java |
| Read and write HEIC and other Image formats in Java |

Is there anything in the PDF Reference related to this statement you made?:
> The order they are listed is not important as all keys and their values are read before anything happens with the object.