---
title: "selection(from:at:to:at:with:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfdocument/selection(from:at:to:at:with:)"
---

# selection(from:at:to:at:with:)

## Declaration

```swift
func selection(from startPage: PDFPage, at startPoint: CGPoint, to endPage: PDFPage, at endPoint: CGPoint, with granularity: PDFSelectionGranularity) -> PDFSelection?
```

```swift
func selection(from startPage: PDFPage, at startPoint: NSPoint, to endPage: PDFPage, at endPoint: NSPoint, with granularity: PDFSelectionGranularity) -> PDFSelection?
```
