<!--
{
  "documentType" : "article",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/cgpdfstring",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "CGPDFString"
}
-->

# CGPDFString

A text string in a PDF document.

## Discussion

A PDF string object is 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 object 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.

## Topics

### Converting PDF Strings

[`CGPDFStringCopyTextString`](/documentation/CoreGraphics/CGPDFStringCopyTextString(_:))

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

[`CGPDFStringCopyDate`](/documentation/CoreGraphics/CGPDFStringCopyDate(_:))

Converts a string to a date.

### Getting PDF String Data

[`CGPDFStringGetBytePtr`](/documentation/CoreGraphics/CGPDFStringGetBytePtr(_:))

Returns a pointer to the bytes of a PDF string.

[`CGPDFStringGetLength`](/documentation/CoreGraphics/CGPDFStringGetLength(_:))

Returns the number of bytes in a PDF string.

### Data Types

[`CGPDFStringRef`](/documentation/CoreGraphics/CGPDFStringRef)

A data type that represents a string in a PDF document.

## See Also

  [Quartz 2D Programming Guide](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)