# PDFViewer.clientToPage()

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

The reverse of [pageToClient](https://kernstra.com/docs/web-sdk/api/pdfviewer/pagetoclient): CSS pixels from the container's top-left corner, as the page holds them.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `Rect \| Point` | CSS pixels from the container's top-left corner. |
| `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
container.addEventListener('click', (e) => {
  const bounds = container.getBoundingClientRect();
  const at = viewer.clientToPage({ x: e.clientX - bounds.left, y: e.clientY - bounds.top }, 0);
  // at: where on page 0 the user clicked, in page space, or null
});
```

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/clienttopage
