---
title: "CGPDFStringGetLength(_:)"
framework: coregraphics
role: symbol
role_heading: Function
path: "coregraphics/cgpdfstringgetlength(_:)"
---

# CGPDFStringGetLength(_:)

Returns the number of bytes in a PDF string.

## Declaration

```swift
func CGPDFStringGetLength(_ string: CGPDFStringRef) -> Int
```

## Parameters

- `string`: A PDF string.

## Return Value

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

## See Also

### Getting PDF String Data

- [CGPDFStringGetBytePtr(_:)](coregraphics/cgpdfstringgetbyteptr(_:).md)
