CGPDFDictionary

A dictionary structure within a PDF document.

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 NO. If there is an object associated with the specified key and it is of the expected type, the function returns YES 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

Applies a function to each entry in a dictionary.

Getting Data from a Dictionary

CGPDFDictionaryGetArray

Returns whether there is a PDF array associated with a specified key in a PDF dictionary and, if so, retrieves that array.

CGPDFDictionaryGetBoolean

Returns whether there is a PDF Boolean value associated with a specified key in a PDF dictionary and, if so, retrieves the Boolean value.

CGPDFDictionaryGetCount

Returns the number of entries in a PDF dictionary.

CGPDFDictionaryGetDictionary

Returns whether there is another PDF dictionary associated with a specified key in a PDF dictionary and, if so, retrieves that dictionary.

CGPDFDictionaryGetInteger

Returns whether there is a PDF integer associated with a specified key in a PDF dictionary and, if so, retrieves that integer.

CGPDFDictionaryGetName

Returns whether an object with a specified key in a PDF dictionary is a PDF name reference (represented as a constant C string) and, if so, retrieves that name.

CGPDFDictionaryGetNumber

Returns whether there is a PDF number associated with a specified key in a PDF dictionary and, if so, retrieves that number.

CGPDFDictionaryGetObject

Returns whether there is a PDF object associated with a specified key in a PDF dictionary and, if so, retrieves that object.

CGPDFDictionaryGetStream

Returns whether there is a PDF stream associated with a specified key in a PDF dictionary and, if so, retrieves that stream.

CGPDFDictionaryGetString

Returns whether there is a PDF string associated with a specified key in a PDF dictionary and, if so, retrieves that string.

Callbacks

CGPDFDictionaryApplierFunction

Performs custom processing on a key-value pair from a PDF dictionary, using optional contextual information.

Data Types

CGPDFDictionaryRef

A type that encapsulates a PDF dictionary.

See Also

Opaque Types

CGBitmapContext

A type of CGContextRef that you can use for drawing bits to memory.

CGColor

A set of components that define a color, with a color space specifying how to interpret them.

CGColorConversionInfo

An object that describes how to convert between color spaces for use by other system services.

CGColorSpace

A profile that specifies how to interpret a color value for display.

CGContext

A Quartz 2D drawing destination.

CGDataConsumer

An abstraction for data-writing tasks that eliminates the need to manage a raw memory buffer.

CGDataProvider

An abstraction for data-reading tasks that eliminates the need to manage a raw memory buffer.

CGFont

A set of character glyphs and layout information for drawing text.

CGFunction

A general facility for defining and using callback functions.

CGGLContext

Deprecated. A type of CGContextRef for drawing OpenGL content.

CGGradient

A definition for a smooth transition between colors for drawing radial and axial gradient fills.

CGImage

A bitmap image or image mask.

CGLayer

An offscreen context for reusing content drawn with Core Graphics.

CGPath

Immutable and mutable types for graphics paths: mathematical descriptions of shapes or lines to be drawn in a graphics context.

CGPattern

A 2D pattern to be used for drawing graphics paths.

CGPDFArray

An array structure within a PDF document.

CGPDFContentStream

A representation of one or more content data streams in a PDF page.

CGPDFContext

A type of CGContextRef for drawing PDF content.

CGPDFDocument

A document that contains PDF (Portable Document Format) drawing information.

CGPDFObject

An object representing content within a PDF document.

CGPDFOperatorTable

A set of callback functions for operators used when scanning content in a PDF document.

CGPDFPage

A page in a PDF document.

CGPDFScanner

A parser object for handling content and operators in a PDF content stream.

CGPDFStream

A stream or sequence of data bytes in a PDF document.

CGPDFString

A text string in a PDF document.

CGPSConverter

An object that converts PostScript data to PDF data.

CGShading

A definition for a smooth transition between colors, controlled by a custom function you provide, for drawing radial and axial gradient fills.