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

# CGPDFOperatorTable

A set of callback functions for operators used when scanning content in a PDF document.

## Discussion

You pass an operator table and a PDF content stream to a CGPDFScanner object. When the scanner parses a PDF operator, Core Graphics invokes your callback for that operator. See also [CGPDFScanner](/documentation/CoreGraphics/cgpdfscanner) and [CGPDFContentStream](/documentation/CoreGraphics/cgpdfcontentstream).

> Note:
> This object is not derived from CFType and therefore you can’t use the Core Foundation base functions on it, such as <doc://com.apple.documentation/documentation/CoreFoundation/CFRetain> and <doc://com.apple.documentation/documentation/CoreFoundation/CFRelease>. In Objective-C, handle memory management with ``doc://com.apple.coregraphics/documentation/CoreGraphics/CGPDFOperatorTableRetain(_:)`` and ``doc://com.apple.coregraphics/documentation/CoreGraphics/CGPDFOperatorTableRelease(_:)``.

For more about PDF operators, see the latest version of *PDF Reference*, Adobe Systems Incorporated.

## Topics

### Creating a PDF Operator Table

[`func CGPDFOperatorTableCreate() -> CGPDFOperatorTableRef?`](/documentation/CoreGraphics/CGPDFOperatorTableCreate())

Creates an empty PDF operator table.

### Setting Callback Functions

[`func CGPDFOperatorTableSetCallback(CGPDFOperatorTableRef, UnsafePointer<CChar>, CGPDFOperatorCallback)`](/documentation/CoreGraphics/CGPDFOperatorTableSetCallback(_:_:_:))

Sets a callback function for a PDF operator.

### Retaining and Releasing a PDF Operator Table

[`func CGPDFOperatorTableRetain(CGPDFOperatorTableRef) -> CGPDFOperatorTableRef`](/documentation/CoreGraphics/CGPDFOperatorTableRetain(_:))

Increments the retain count of a CGPDFOperatorTable object.

[`func CGPDFOperatorTableRelease(CGPDFOperatorTableRef)`](/documentation/CoreGraphics/CGPDFOperatorTableRelease(_:))

Decrements the retain count of a CGPDFOperatorTable object.

### Callbacks

[`typealias CGPDFOperatorCallback`](/documentation/CoreGraphics/CGPDFOperatorCallback)

Performs custom processing for PDF operators.

### Data Types

[`typealias CGPDFOperatorTableRef`](/documentation/CoreGraphics/CGPDFOperatorTableRef)

A type that stores callback functions for PDF operators.



---

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)