CGPDFString Reference

Derived from
None
Framework
ApplicationServices/ApplicationServices.h
Companion guide
Declared in
CGPDFString.h

Overview

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 by Task

Converting PDF Strings

Getting PDF String Data

Functions

CGPDFStringCopyDate

Converts a string to a date.

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 OS X version 10.4 and later.
Declared In
CGPDFString.h

CGPDFStringCopyTextString

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

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 OS X version 10.3 and later.
Declared In
CGPDFString.h

CGPDFStringGetBytePtr

Returns a pointer to the bytes of a PDF string.

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.

Availability
  • Available in OS X version 10.3 and later.
Declared In
CGPDFString.h

CGPDFStringGetLength

Returns the number of bytes in a PDF string.

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.

Availability
  • Available in OS X version 10.3 and later.
Declared In
CGPDFString.h

Data Types

CGPDFStringRef

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

typedef struct CGPDFString *CGPDFStringRef;
Availability
  • Available in OS X v10.3 and later.
Declared In
CGPDFString.h