Next Page > Hide TOC

CGPDFObject Reference

Derived from
None
Framework
ApplicationServices/ApplicationServices.h
Companion guide
Declared in
CGPDFObject.h

Overview

The CGPDFObjectRef opaque type represents PDF objects in a PDF document. PDF supports several basic types of object: Boolean values, integer and real numbers, strings, names, arrays, dictionaries, and streams. Most of these are represented in Quartz by corresponding specific types. A CGPDFObject can represent any of these types. You use CGPDFObject functions to determine the type of the object, and retrieve the object value if it is of an expected type.

This opaque type is not derived from CFType and therefore there are no functions for retaining and releasing it. CGPDFObject objects exist as constituent parts of a CGPDFDocument object, and are managed by their container.

Functions

CGPDFObjectGetType

Returns the PDF type identifier of an object.

CGPDFObjectType CGPDFObjectGetType (
   CGPDFObjectRef object
);

Parameters
object

A PDF object. If the value if not a PDF object, the behavior is unspecified.

Return Value

Returns the type of the object parameter. See “Data Types.”

Availability
Declared In
CGPDFObject.h

CGPDFObjectGetValue

Returns whether an object is of a given type and if it is, retrieves its value.

bool CGPDFObjectGetValue (
   CGPDFObjectRef object,
   CGPDFObjectType type,
   void *value
);

Parameters
object

A PDF object.

type

A PDF object type.

value

If the object parameter is a PDF object of the specified type, then on return contains that object, otherwise the value is unspecified.

Return Value

Returns true if the specified object is a PDF object of the specified type, otherwise false.

Discussion

The function gets the value of the object parameter. If the type of object is equal to the type specified, then:

If the type of object is kCGPDFObjectTypeInteger and type is equal to kCGPDFObjectTypeReal, then the value of object is converted to floating point, the result copied to value, and the function returns true. If none of the preceding conditions is met, returns false.

Availability
Declared In
CGPDFObject.h

Data Types

CGPDFObjectRef

An opaque type that contains information about a PDF object.

typedef union CGPDFObject *CGPDFObjectRef;

Availability
Declared In
CGPDFObject.h

CGPDFBoolean

A PDF Boolean value.

typedef unsigned char CGPDFBoolean;

Availability
Declared In
CGPDFObject.h

CGPDFInteger

A PDF integer value.

typedef long int CGPDFInteger;

Availability
Declared In
CGPDFObject.h

CGPDFReal

A PDF real value.

typedef CGFloat CGPDFReal;

Availability
Declared In
CGPDFObject.h

Constants

PDF Object Types

Types of PDF object.

enum CGPDFObjectType {
   kCGPDFObjectTypeNull = 1,
   kCGPDFObjectTypeBoolean,
   kCGPDFObjectTypeInteger,
   kCGPDFObjectTypeReal,
   kCGPDFObjectTypeName,
   kCGPDFObjectTypeString,
   kCGPDFObjectTypeArray,
   kCGPDFObjectTypeDictionary,
   kCGPDFObjectTypeStream
};typedef enum CGPDFObjectType CGPDFObjectType;

Constants
kCGPDFObjectTypeNull

The type for a PDF null.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeBoolean

The type for a PDF Boolean.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeInteger

The type for a PDF integer.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeReal

The type for a PDF real.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeName

Type for a PDF name.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeString

The type for a PDF string.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeArray

Type for a PDF array.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeDictionary

The type for a PDF dictionary.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

kCGPDFObjectTypeStream

The type for a PDF stream.

Available in Mac OS X v10.3 and later.

Declared in CGPDFObject.h.

Declared In
CGPDFObject.h

Next Page > Hide TOC


© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-10-15)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.