---
title: CGPDFDictionary
framework: coregraphics
role: collectionGroup
role_heading: API Collection
path: coregraphics/cgpdfdictionary
---

# CGPDFDictionary

A dictionary structure within a PDF document.

## Overview

Overview Dictionary objects are the main building blocks of a PDF document. A key-value pair within a dictionary is called an entry. In a PDF dictionary, the key must be an array of characters. Within a given dictionary, the keys are unique—that is, no two keys in a single dictionary are equal (as determined by strcmp). The value associated with a key can be any kind of PDF object, including another dictionary. Dictionary objects are the main building blocks of a PDF document. Many functions that retrieve values from a PDF dictionary take the form: bool CGPDFDictionaryGet<DataType> (  CGPDFDictionaryRef dictionary,  const char *key,  <DataType>Ref *value ); These functions test whether there is an object associated with the specified key. If there is an object associated with the specified key, they test its data type. If there is no associated object, or if there is but it is not of the expected type, the function returns false. If there is an object associated with the specified key and it is of the expected type, the function returns true and the object is passed back in the value parameter. This object is not derived from CFType and therefore there are no functions for retaining and releasing it. CGPDFDictionary objects exist only as constituent parts of a CGPDFDocument object, and they are managed by their container.

## Topics

### Applying a Function to All Entries

- [CGPDFDictionaryApplyFunction(_:_:_:)](coregraphics/cgpdfdictionaryapplyfunction(_:_:_:).md)

### Getting Data from a Dictionary

- [CGPDFDictionaryGetArray(_:_:_:)](coregraphics/cgpdfdictionarygetarray(_:_:_:).md)
- [CGPDFDictionaryGetBoolean(_:_:_:)](coregraphics/cgpdfdictionarygetboolean(_:_:_:).md)
- [CGPDFDictionaryGetCount(_:)](coregraphics/cgpdfdictionarygetcount(_:).md)
- [CGPDFDictionaryGetDictionary(_:_:_:)](coregraphics/cgpdfdictionarygetdictionary(_:_:_:).md)
- [CGPDFDictionaryGetInteger(_:_:_:)](coregraphics/cgpdfdictionarygetinteger(_:_:_:).md)
- [CGPDFDictionaryGetName(_:_:_:)](coregraphics/cgpdfdictionarygetname(_:_:_:).md)
- [CGPDFDictionaryGetNumber(_:_:_:)](coregraphics/cgpdfdictionarygetnumber(_:_:_:).md)
- [CGPDFDictionaryGetObject(_:_:_:)](coregraphics/cgpdfdictionarygetobject(_:_:_:).md)
- [CGPDFDictionaryGetStream(_:_:_:)](coregraphics/cgpdfdictionarygetstream(_:_:_:).md)
- [CGPDFDictionaryGetString(_:_:_:)](coregraphics/cgpdfdictionarygetstring(_:_:_:).md)

### Callbacks

- [CGPDFDictionaryApplierFunction](coregraphics/cgpdfdictionaryapplierfunction.md)

### Data Types

- [CGPDFDictionaryRef](coregraphics/cgpdfdictionaryref.md)

## See Also

### Related Documentation

- [Quartz 2D Programming Guide](apple-archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction.md)
