---
title: "setMaximumLength(_:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfannotationtextwidget/setmaximumlength(_:)"
---

# setMaximumLength(_:)

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

## Declaration

```swift
func setMaximumLength(_ maxLen: Int)
```

## Parameters

- `maxLen`: The maximum number of characters allowed in the annotation string. Pass 0 to indicate 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)
- [maximumLength()](pdfkit/pdfannotationtextwidget/maximumlength().md)
