---
title: "draw(for:with:active:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfselection/draw(for:with:active:)"
---

# draw(for:with:active:)

Draws the selection relative to the origin of the specified box in page space.

## Declaration

```swift
func draw(for page: PDFPage, with box: PDFDisplayBox, active: Bool)
```

## Discussion

Discussion The selection is drawn using the current highlight color. If active is true, drawing uses selectedTextBackgroundColor. If false, it uses secondarySelectedControlColor. Refer to the PDFPage class for the list of available box types. Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page.

## See Also

### Managing Selection Drawing

- [draw(for:active:)](pdfkit/pdfselection/draw(for:active:).md)
- [color](pdfkit/pdfselection/color.md)
