# PDFViewer.pageToClient()

```ts
pageToClient<T extends Rect | Point>(value: T, pageIndex: number): T | null
```

A point or rectangle of a page, in page space, as it lies in the viewer now: CSS pixels from the container's top-left corner at the current zoom, scroll and rotation (a `Rect` comes back with its top-left corner as `x, y`, as the DOM measures). Convert again after [zoomChanged](https://kernstra.com/docs/web-sdk/api/events#ev-zoomchanged), a scroll or a resize. Page space and the geometry helpers are described under [Helpers](https://kernstra.com/docs/web-sdk/api/helpers).

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `Rect \| Point` | A point or rectangle in page space. |
| `pageIndex` | `number` | Zero-based page index. |

Returns `Rect | Point | null`: `null` before the page is laid out, or on a destroyed viewer.

Throws:

- `INVALID_ARGUMENT` for a page index the document has not, or a value that is neither a `Point` nor a `Rect` of finite numbers.

```ts
const [field] = await doc.forms.fields(0);
const box = field ? viewer.pageToClient(field.rect, 0) : null;
if (box) {
  badge.style.transform = `translate(${box.x}px, ${box.y}px)`;
}
```

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

Web page: https://kernstra.com/docs/web-sdk/api/pdfviewer/pagetoclient
