Mac Developer Library

Developer

ApplicationServices Framework Reference 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) -> Unmanaged<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.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.3 and later.

  • Converts a string to a date.

    Declaration

    Swift

    func CGPDFStringCopyDate(_ string: CGPDFStringRef) -> Unmanaged<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.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.4 and later.

  • Returns a pointer to the bytes of a PDF string.

    Declaration

    Swift

    func CGPDFStringGetBytePtr(_ string: CGPDFStringRef) -> UnsafePointer<UInt8>

    Objective-C

    const unsigned char * CGPDFStringGetBytePtr ( CGPDFStringRef string );

    Parameters

    string

    A PDF string.

    Return Value

    Returns a pointer to the bytes of the specified string. If the string is NULL, the function returns NULL.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.3 and later.

  • Returns the number of bytes in a PDF string.

    Declaration

    Swift

    func CGPDFStringGetLength(_ string: CGPDFStringRef) -> UInt

    Objective-C

    size_t CGPDFStringGetLength ( CGPDFStringRef string );

    Parameters

    string

    A PDF string.

    Return Value

    Returns the number of bytes referenced by the string, or 0 if the string is NULL.

    Import Statement

    import CoreGraphics

    Availability

    Available in OS X version 10.3 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

    import CoreGraphics

    Availability

    Available in OS X v10.3 and later.