---
title: "CGPDFContentStreamCreateWithStream(_:_:_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgpdfcontentstreamcreatewithstream(_:_:_:)"
---

# CGPDFContentStreamCreateWithStream(_:_:_:)

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

## Declaration

```swift
func CGPDFContentStreamCreateWithStream(_ stream: CGPDFStreamRef, _ streamResources: CGPDFDictionaryRef, _ parent: CGPDFContentStreamRef) -> CGPDFContentStreamRef
```

## 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

Return Value A PDF content stream object created from the stream parameter. In Objective-C, you’re responsible for releasing this object by calling the CGPDFContentStreamRelease(_:) function.

## Discussion

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

## See Also

### Creating a PDF Content Stream Object

- [CGPDFContentStreamCreateWithPage(_:)](coregraphics/cgpdfcontentstreamcreatewithpage(_:).md)
