---
title: "convert(_:to:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfview/convert(_:to:)-8cp0c"
---

# convert(_:to:)

Converts a rectangle from view space to page space.

## Declaration

```swift
func convert(_ rect: CGRect, to page: PDFPage) -> CGRect
```

```swift
func convert(_ rect: NSRect, to page: PDFPage) -> NSRect
```

## Discussion

Discussion Page space is a 72 dpi coordinate system with the origin at the lower-left corner of the current page. View space is a coordinate system with the origin at the lower-left corner of the current PDF view.

## See Also

### Converting Page and View Points

- [page(for:nearest:)](pdfkit/pdfview/page(for:nearest:).md)
- [convert(_:to:)](pdfkit/pdfview/convert(_:to:)-9twqk.md)
- [convert(_:from:)](pdfkit/pdfview/convert(_:from:)-4evlx.md)
- [convert(_:from:)](pdfkit/pdfview/convert(_:from:)-9xv1z.md)
