iOS Developer Library

Developer

Core Text Reference Collection CGPDFString Reference

Options
Deployment Target:

On This Page
Language:

CGPDFString Reference

The CGPDFStringRef opaque type represents a string in a PDF document A PDF string object of a series of bytes—unsigned integer values in the range 0 to 255. The string elements are not integer objects, but are stored in a more compact format. For more information on the representation of strings in PDF, see the latest version of PDF Reference, Adobe Systems Incorporated.

This opaque type is not derived from CFType and therefore there are no functions for retaining and releasing it. CGPDFString objects exist as constituent parts of a CGPDFDocument object, and are managed by their container.

Functions

  • Returns a CFString object that represents a PDF string as a text string.

    Declaration

    Swift

    func CGPDFStringCopyTextString(_ string: CGPDFStringRef) -> CFString?

    Objective-C

    CFStringRef CGPDFStringCopyTextString ( CGPDFStringRef string );

    Parameters

    string

    A PDF string. If this value is NULL, it will cause an error.

    Return Value

    Returns a CFString object that represents the specified PDF string as a text string. You are responsible for releasing this object.

    Availability

    Available in iOS 2.0 and later.

  • Converts a string to a date.

    Declaration

    Swift

    func CGPDFStringCopyDate(_ string: CGPDFStringRef) -> CFDate?

    Objective-C

    CFDateRef CGPDFStringCopyDate ( CGPDFStringRef string );

    Parameters

    string

    The string to convert to a date.

    Return Value

    A CFDate object.

    Discussion

    The PDF specification defines a specific format for strings that represent dates. This function converts strings in that form to CFDate objects.

    Availability

    Available in iOS 2.0 and later.

Data Types

  • An opaque data type that represents a string in a PDF document.

    Declaration

    Swift

    typealias CGPDFStringRef = COpaquePointer

    Objective-C

    typedef struct CGPDFString *CGPDFStringRef;

    Import Statement

    Objective-C

    @import CoreGraphics;

    Swift

    import CoreGraphics

    Availability

    Available in iOS 2.0 and later.