Mac Developer Library

Developer

ApplicationServices Framework Reference CGPDFContentStream Reference

Options
Deployment Target:

On This Page
Language:

CGPDFContentStream Reference

The CGPDFContentStreamRef opaque type provides access to the data that describes the appearance of a PDF page. A CGPDFContentStream object represents one or more PDF content streams for a page and their associated resource dictionaries. A PDF content stream is a sequential set of instructions that specifies how to paint items on a PDF page. A resource dictionary contains information needed by the content stream in order to decode the sequential instructions of the content stream.

CGPDFContentStream functions can retrieve both the content streams and the resource dictionaries associated with a PDF page.

This opaque type is not derived from CFType and therefore there are no functions for retaining and releasing it.

Functions

  • Creates a content stream object from a PDF page object.

    Declaration

    Swift

    func CGPDFContentStreamCreateWithPage(_ page: CGPDFPage!) -> CGPDFContentStream!

    Objective-C

    CGPDFContentStreamRef CGPDFContentStreamCreateWithPage ( CGPDFPageRef page );

    Parameters

    page

    A PDF page object.

    Return Value

    A new CGPDFContentStream object. You are responsible for releasing this object by calling the function CGPDFContentStreamRelease.

    Discussion

    A CGPDFContentStream object can contain more than one PDF content stream. To retrieve an array of the PDF content streams in the object, call the function CGPDFContentStreamGetStreams. To obtain the resources associated with a CGPDFContentStream object, call the function CGPDFContentStreamGetResource.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.4 and later.

  • Creates a PDF content stream object from an existing PDF content stream object.

    Declaration

    Swift

    func CGPDFContentStreamCreateWithStream(_ stream: CGPDFStreamRef, _ streamResources: CGPDFDictionaryRef, _ parent: CGPDFContentStream!) -> CGPDFContentStream!

    Objective-C

    CGPDFContentStreamRef CGPDFContentStreamCreateWithStream ( CGPDFStreamRef stream, CGPDFDictionaryRef streamResources, CGPDFContentStreamRef parent );

    Parameters

    stream

    The PDF stream you want to create a content stream from.

    streamResources

    A PDF dictionary that contains the resources associated with the stream you want to retrieve.

    parent

    The content stream of the page on which stream appears. Supply the parent parameter when you create a content stream that’s used within a page.

    Return Value

    A CGPDFContentStream object created from the stream parameter. You are responsible for releasing this object by calling the function CGPDFContentStreamRelease.

    Discussion

    You can use this function to get access to the contents of a form, pattern, Type3 font, or any PDF stream.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.4 and later.

  • Gets the array of PDF content streams contained in a PDF content stream object.

    Declaration

    Swift

    func CGPDFContentStreamGetStreams(_ cs: CGPDFContentStream!) -> CFArray!

    Objective-C

    CFArrayRef CGPDFContentStreamGetStreams ( CGPDFContentStreamRef cs );

    Parameters

    cs

    A CGPDFContentStream object.

    Return Value

    The array of PDF content streams that make up the content stream object represented by the cs parameter.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.4 and later.

  • Gets the specified resource from a PDF content stream object.

    Declaration

    Swift

    func CGPDFContentStreamGetResource(_ cs: CGPDFContentStream!, _ category: UnsafePointer<Int8>, _ name: UnsafePointer<Int8>) -> CGPDFObjectRef

    Objective-C

    CGPDFObjectRef CGPDFContentStreamGetResource ( CGPDFContentStreamRef cs, const char *category, const char *name );

    Parameters

    cs

    A CGPDFContentStream object.

    category

    A string that specifies the category of the resource you want to obtain.

    name

    A string that specifies the name of the resource you want to obtain.

    Return Value

    The resource dictionary.

    Discussion

    You can use this function to obtain resources used by the content stream, such as forms, patterns, color spaces, and fonts.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.4 and later.

Data Types

  • An opaque type that provides access to the data that describes the appearance of a PDF page.

    Declaration

    Swift

    typealias CGPDFContentStreamRef = CGPDFContentStream

    Objective-C

    typedef struct CGPDFContentStream *CGPDFContentStreamRef;

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X v10.4 and later.