iOS Developer Library

Developer

ApplicationServices Framework Reference CGPDFOperatorTable Reference

Options
Deployment Target:

On This Page
Language:

CGPDFOperatorTable Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import CoreGraphics

Objective-C

@import CoreGraphics;

A CGPDFOperatorTable object stores callback functions for PDF operators. You pass an operator table and a PDF content stream to a CGPDFScanner object. When the scanner parses a PDF operator, Quartz invokes your callback for that operator. See also CGPDFScanner Reference and CGPDFContentStream Reference.

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

Functions

  • Sets a callback function for a PDF operator.

    Declaration

    Swift

    func CGPDFOperatorTableSetCallback(_ table: CGPDFOperatorTableRef, _ name: UnsafePointer<Int8>, _ callback: CGPDFOperatorCallback)

    Objective-C

    void CGPDFOperatorTableSetCallback ( CGPDFOperatorTableRef table, const char *name, CGPDFOperatorCallback callback );

    Parameters

    table

    A PDF operator table.

    name

    The name of the PDF operator you want to set a callback for.

    callback

    The callback to invoke for the PDF operator specified by the name parameter.

    Discussion

    You call the function CGPDFOperatorTableSetCallback for each PDF operator for which you want to provide a callback. See Appendix A in the PDF Reference, Second Edition, version 1.3, Adobe Systems Incorporated for a summary of PDF operators.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

Callbacks

  • Performs custom processing for PDF operators.

    Declaration

    Swift

    typealias CGPDFOperatorCallback = CFunctionPointer<((CGPDFScannerRef, UnsafeMutablePointer<Void>) -> Void)>

    Objective-C

    typedef void (*CGPDFOperatorCallback)( CGPDFScannerRef scanner, void *info );

    Parameters

    scanner

    A CGPDFScanner object. Quartz passes the scanner to your callback function. The scanner contains the PDF content stream that has the PDF operator that corresponds to this callback.

    info

    A pointer to data passed to the callback.

    Discussion

    Your callback function takes any action that’s appropriate for your application. For example, if you want to count the number of inline images in a PDF but ignore the image data, you would set a callback for the EI operator. In your callback you would increment a counter for each call.

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An opaque type that stores callback functions for PDF operators.

    Declaration

    Swift

    typealias CGPDFOperatorTableRef = COpaquePointer

    Objective-C

    typedef struct CGPDFOperatorTable *CGPDFOperatorTableRef;

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.