<!--
{
  "documentType" : "article",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/cgpdfcontentstream",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CGPDFContentStream"
}
-->

# CGPDFContentStream

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

## Discussion

A [`CGPDFContentStreamRef`](/documentation/CoreGraphics/CGPDFContentStreamRef) 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.

[`CGPDFContentStreamRef`](/documentation/CoreGraphics/CGPDFContentStreamRef) functions can retrieve both the content streams and the resource dictionaries associated with a PDF page.

This type is not derived from <doc://com.apple.documentation/documentation/CoreFoundation/CFTypeRef> and therefore there are no functions for retaining and releasing it. [`CGPDFContentStreamRef`](/documentation/CoreGraphics/CGPDFContentStreamRef) objects exist only as constituent parts of a [`CGPDFDocument`](/documentation/CoreGraphics/CGPDFDocument) object, and they are managed by their container.

## Topics

### Creating a PDF Content Stream Object

[`CGPDFContentStreamCreateWithPage(_:)`](/documentation/CoreGraphics/CGPDFContentStreamCreateWithPage(_:))

Creates a content stream object from a PDF page object.

[`CGPDFContentStreamCreateWithStream(_:_:_:)`](/documentation/CoreGraphics/CGPDFContentStreamCreateWithStream(_:_:_:))

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

### Getting Data from a PDF Content Stream Object

[`CGPDFContentStreamGetStreams(_:)`](/documentation/CoreGraphics/CGPDFContentStreamGetStreams(_:))

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

[`CGPDFContentStreamGetResource(_:_:_:)`](/documentation/CoreGraphics/CGPDFContentStreamGetResource(_:_:_:))

Gets the specified resource from a PDF content stream object.

### Retaining and Releasing a PDF Content Stream Object

[`CGPDFContentStreamRetain(_:)`](/documentation/CoreGraphics/CGPDFContentStreamRetain(_:))

Increments the retain count of a PDF content stream object.

[`CGPDFContentStreamRelease(_:)`](/documentation/CoreGraphics/CGPDFContentStreamRelease(_:))

Decrements the retain count of a PDF content stream object.

### Data Types

[`CGPDFContentStreamRef`](/documentation/CoreGraphics/CGPDFContentStreamRef)

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

## See Also

  [Quartz 2D Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)