iOS Developer Library

Developer

Core Text Reference Collection CGPDFScanner Reference

Options
Deployment Target:

On This Page
Language:

CGPDFScanner Reference

The CGPDFScannerRef opaque type is used to parse a PDF content stream. You can set up the PDF scanner object to invoke callbacks when it encounters specific PDF operators in the stream.

This opaque type is not derived from CFType. Use CGPDFScannerRetain and CGPDFScannerRelease to manage the retain count of CGPDFScannerRef instances; do not use CFRetain and CFRelease.

Functions

  • Parses the content stream of a PDF scanner object.

    Declaration

    Swift

    func CGPDFScannerScan(_ scanner: CGPDFScannerRef) -> Bool

    Objective-C

    bool CGPDFScannerScan ( CGPDFScannerRef scanner );

    Parameters

    scanner

    The scanner object whose content stream you want to parse.

    Return Value

    true if the entire stream is parsed successfully; false if parsing fails (for example, if the stream data is corrupted).

    Discussion

    The function CGPDFScannerScan parses the PDF content stream associated with the scanner. Each time Quartz parses a PDF operator for which you register a callback, Quartz invokes your callback.

    Availability

    Available in iOS 2.0 and later.

  • Returns the content stream associated with a PDF scanner object.

    Declaration

    Swift

    func CGPDFScannerGetContentStream(_ scanner: CGPDFScannerRef) -> CGPDFContentStreamRef

    Objective-C

    CGPDFContentStreamRef CGPDFScannerGetContentStream ( CGPDFScannerRef scanner );

    Parameters

    scanner

    The scanner object whose content stream you want to obtain.

    Return Value

    The content stream associated with scanner.

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An opaque type used to parse a PDF content stream.

    Declaration

    Swift

    typealias CGPDFScannerRef = COpaquePointer

    Objective-C

    typedef struct CGPDFScanner *CGPDFScannerRef;

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.