---
title: "getBoxRect(_:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgpdfpage/getboxrect(_:)"
---

# getBoxRect(_:)

Returns the rectangle that represents a type of box for a content region or page dimensions of a PDF page.

## Declaration

```swift
func getBoxRect(_ box: CGPDFBox) -> CGRect
```

## Parameters

- `box`: A constant that specifies the type of box. For possible values, see doc://com.apple.coregraphics/documentation/CoreGraphics/CGPDFBox.

## Return Value

Return Value Returns the rectangle associated with the type of box specified by the box parameter in the specified page.

## Discussion

Discussion Returns the rectangle associated with the specified box in the specified page. This is the value of the corresponding entry (such as /MediaBox, /ArtBox, and so on) in the page’s dictionary.

## See Also

### Getting Page Information

- [dictionary](coregraphics/cgpdfpage/dictionary.md)
- [document](coregraphics/cgpdfpage/document.md)
- [pageNumber](coregraphics/cgpdfpage/pagenumber.md)
- [rotationAngle](coregraphics/cgpdfpage/rotationangle.md)
- [getDrawingTransform(_:rect:rotate:preserveAspectRatio:)](coregraphics/cgpdfpage/getdrawingtransform(_:rect:rotate:preserveaspectratio:).md)
