---
title: CGPDFDocumentRetain
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgpdfdocumentretain
---

# CGPDFDocumentRetain

Increments the retain count of a Core Graphics PDF document.

## Declaration

```occ
extern CGPDFDocumentRefCGPDFDocumentRetain(CGPDFDocumentRef document);
```

## Parameters

- `document`: The PDF document to retain.

## Return Value

Return Value The same document you passed in as the document parameter.

## Discussion

Discussion This function is equivalent to CFRetain, except that it does not cause an error if the document parameter is NULL.

## See Also

### Retaining and Releasing PDF Documents

- [CGPDFDocumentRelease](coregraphics/cgpdfdocumentrelease.md)
