iOS Developer Library

Developer

ApplicationServices Framework Reference CGPDFArray Reference

Options
Deployment Target:

On This Page
Language:

CGPDFArray Reference

The CGPDFArray header file defines an opaque type that encapsulates a PDF array. A PDF array represents an array structure in a PDF document. PDF arrays may be heterogeneous—that is, they may contain any other PDF objects, including PDF strings, PDF dictionaries, and other PDF arrays.

Many CGPDFArray functions to retrieve values from a PDF array take the form:

  • bool CGPDFArrayGet<DataType> (
  • CGPDFArrayRef array,
  • size_t index,
  • <DataType>Ref *value
  • );

These functions test the data type of the object at the specified index. If the object is not of the expected type, the function returns false. If the object is of the expected type, the function returns true, and the object is passed back in the value parameter.

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

Functions

  • Returns whether an object at a given index in a PDF array is another PDF array and, if so, retrieves that array.

    Declaration

    Swift

    func CGPDFArrayGetArray(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFArrayRef>) -> Bool

    Objective-C

    bool CGPDFArrayGetArray ( CGPDFArrayRef array, size_t index, CGPDFArrayRef *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF array. If the value at the specified index is a PDF array, then on return that array, otherwise the value is unspecified.

    Return Value

    Returns true if there is a PDF array at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF Boolean and, if so, retrieves that Boolean.

    Declaration

    Swift

    func CGPDFArrayGetBoolean(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFBoolean>) -> Bool

    Objective-C

    bool CGPDFArrayGetBoolean ( CGPDFArrayRef array, size_t index, CGPDFBoolean *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of array (0 to N-1, where N is the count of array), the behavior is undefined.

    value

    On input, a pointer to a PDF Boolean. If the value at the specified index is a PDF Boolean, then on return that Boolean, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF Boolean at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns the number of items in a PDF array.

    Declaration

    Swift

    func CGPDFArrayGetCount(_ array: CGPDFArrayRef) -> UInt

    Objective-C

    size_t CGPDFArrayGetCount ( CGPDFArrayRef array );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    Return Value

    Returns the number of items in the array.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF dictionary and, if so, retrieves that dictionary.

    Declaration

    Swift

    func CGPDFArrayGetDictionary(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFDictionaryRef>) -> Bool

    Objective-C

    bool CGPDFArrayGetDictionary ( CGPDFArrayRef array, size_t index, CGPDFDictionaryRef *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF dictionary. If the value at the specified index is a PDF dictionary, then on return that dictionary, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF dictionary at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF integer and, if so, retrieves that object.

    Declaration

    Swift

    func CGPDFArrayGetInteger(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFInteger>) -> Bool

    Objective-C

    bool CGPDFArrayGetInteger ( CGPDFArrayRef array, size_t index, CGPDFInteger *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF integer. If the value at the specified index is a PDF integer value, then on return contains that value, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF integer at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF name reference (represented as a constant C string) and, if so, retrieves that name.

    Declaration

    Swift

    func CGPDFArrayGetName(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<UnsafePointer<Int8>>) -> Bool

    Objective-C

    bool CGPDFArrayGetName ( CGPDFArrayRef array, size_t index, const char **value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    An uninitialized pointer to a constant C string. If the value at the specified index is a reference to a PDF name (represented by a constant C string) then upon return, contains that value; otherwise the value is undefined.

    Return Value

    Returns true if there is an array of characters at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a Quartz PDF array is a PDF null.

    Declaration

    Swift

    func CGPDFArrayGetNull(_ array: CGPDFArrayRef, _ index: UInt) -> Bool

    Objective-C

    bool CGPDFArrayGetNull ( CGPDFArrayRef array, size_t index );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    Return Value

    Returns true if there is a PDF null at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF number and, if so, retrieves that object.

    Declaration

    Swift

    func CGPDFArrayGetNumber(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFReal>) -> Bool

    Objective-C

    bool CGPDFArrayGetNumber ( CGPDFArrayRef array, size_t index, CGPDFReal *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF number. If the value at the specified index is a PDF number, then on return contains that value, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF number at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF object and, if so, retrieves that object.

    Declaration

    Swift

    func CGPDFArrayGetObject(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFObjectRef>) -> Bool

    Objective-C

    bool CGPDFArrayGetObject ( CGPDFArrayRef array, size_t index, CGPDFObjectRef *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF object. If the value at the specified index is a PDF object, then on return contains that object, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF object at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF stream and, if so, retrieves that stream.

    Declaration

    Swift

    func CGPDFArrayGetStream(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFStreamRef>) -> Bool

    Objective-C

    bool CGPDFArrayGetStream ( CGPDFArrayRef array, size_t index, CGPDFStreamRef *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF stream. If the value at the specified index is a PDF stream, then on return that stream, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF stream at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

  • Returns whether an object at a given index in a PDF array is a PDF string and, if so, retrieves that string.

    Declaration

    Swift

    func CGPDFArrayGetString(_ array: CGPDFArrayRef, _ index: UInt, _ value: UnsafeMutablePointer<CGPDFStringRef>) -> Bool

    Objective-C

    bool CGPDFArrayGetString ( CGPDFArrayRef array, size_t index, CGPDFStringRef *value );

    Parameters

    array

    A PDF array. If this parameter is not a valid PDF array, the behavior is undefined.

    index

    The index of the value to retrieve. If the index is outside the index space of the array (0 to N-1, where N is the count of the array), the behavior is undefined.

    value

    On input, a pointer to a PDF string. If the value at the specified index is a PDF string, then on return that string, otherwise the value is undefined.

    Return Value

    Returns true if there is a PDF stream at the specified index, otherwise false.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An opaque type that encapsulates a PDF array.

    Declaration

    Swift

    typealias CGPDFArrayRef = COpaquePointer

    Objective-C

    typedef struct CGPDFArray *CGPDFArrayRef;

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.