---
title: maximumLength()
framework: pdfkit
role: symbol
role_heading: Instance Method
path: pdfkit/pdfannotationtextwidget/maximumlength()
---

# maximumLength()

Returns the maximum number of characters allowed in the annotation string.

## Declaration

```swift
func maximumLength() -> Int
```

## Return Value

Return Value The maximum number of characters allowed in the annotations string. A return value of 0 means that there is no specified maximum.

## See Also

### Related Documentation

- [PDFAnnotationTextWidget](pdfkit/pdfannotationtextwidget.md)

### Working with Annotation Strings

- [stringValue()](pdfkit/pdfannotationtextwidget/stringvalue().md)
- [setStringValue(_:)](pdfkit/pdfannotationtextwidget/setstringvalue(_:).md)
- [setMaximumLength(_:)](pdfkit/pdfannotationtextwidget/setmaximumlength(_:).md)
