<!--
{
  "availability" : [
    "macOS: 10.4.0 - 10.12.0"
  ],
  "documentType" : "symbol",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/PDFPage/draw(with:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "PDFKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PDFPage(im)drawWithBox:"
  },
  "title" : "draw(with:)"
}
-->

# draw(with:)

Draws the page within the specified box.

```
func draw(with box: PDFDisplayBox)
```

## Discussion

This method takes into account the page rotation and draws clipped to the specified box. If the page is set to display annotations, this method also draws them. This method does not clear the background. To clear the background before drawing, use <doc://com.apple.documentation/documentation/AppKit/NSRectFill> with `NSColor` set (typically) to white.

## See Also

[`displaysAnnotations`](/documentation/PDFKit/PDFPage/displaysAnnotations)

Returns a Boolean value indicating whether annotations are displayed for the page.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)