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

# alignment()

Returns the text alignment setting for the annotation.

## Declaration

```swift
func alignment() -> NSTextAlignment
```

## Return Value

Return Value The text alignment value for the annotation. Supported alignment values are NSLeftTextAlignment, NSRightTextAlignment, and NSCenterTextAlignment.

## See Also

### Managing Background Color, Alignment, and Rotation

- [backgroundColor()](pdfkit/pdfannotationtextwidget/backgroundcolor().md)
- [setBackgroundColor(_:)](pdfkit/pdfannotationtextwidget/setbackgroundcolor(_:).md)
- [setAlignment(_:)](pdfkit/pdfannotationtextwidget/setalignment(_:).md)
- [rotation()](pdfkit/pdfannotationtextwidget/rotation().md)
- [setRotation(_:)](pdfkit/pdfannotationtextwidget/setrotation(_:).md)
