# PagesApi.boxes()

```ts
boxes(pageIndex: number): Promise<PageBoxes>
```

The page's MediaBox / CropBox / BleedBox / TrimBox / ArtBox, read without loading it.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `pageIndex` | `number` | Zero-based page index. |

Returns `Promise<PageBoxes>`: `{ mediaBox, cropBox, trimBox, bleedBox, artBox }`, every box a `Rect` in page space, resolved as a reader resolves it: the MediaBox is the full sheet (US Letter when the file has none); the CropBox is what renders (the MediaBox when the file declares none); the TrimBox, BleedBox and ArtBox fall back to the CropBox.

Throws:

- `INVALID_ARGUMENT` — a page index out of range.
- `DOCUMENT_CLOSED` — the document has been closed.

```ts
const { cropBox } = await doc.pages.boxes(0);
console.log(cropBox.width, cropBox.height); // points
```

Part of [PagesApi](https://kernstra.com/docs/web-sdk/api/doc-pages) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/doc-pages/boxes
