---
title: "transformContext(for:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfpage/transformcontext(for:)"
---

# transformContext(for:)

Transforms the current context, given the specified box.

## Declaration

```swift
func transformContext(for box: PDFDisplayBox)
```

## Discussion

Discussion When transforming the current context, this method takes into account the rotation of the page, as well as the origin of the box with respect to the page’s base coordinate system. This is a convenient method to call within the PDFView draw(_:) method or from within a draw method of a PDFAnnotation subclass.

## See Also

### Related Documentation

- [PDFPage](pdfkit/pdfpage.md)

### Rendering Pages

- [draw(with:)](pdfkit/pdfpage/draw(with:).md)
