# PagePointer

## Content

The `PagePointerEvent` in FlexViewer enables applications to detect pointer interactions on a rendered document page. The event returns pointer coordinates relative to the document page (document-space coordinates) instead of screen pixels, enabling accurate positioning for scenarios such as annotations, hit testing, and custom interactive behavior.
This feature is supported for all document sources supported by FlexViewer, including FlexReport, PDF, and <span data-testid="definition-highlighter" class="_5pioz8co _189e1dm9 _1il9buyh _19lc184f _d0altlke" style="border-image: linear-gradient(90deg, rgb(0, 101, 255), rgb(191, 99, 243), rgb(245, 230, 168)) 0 0 100% / 1 / 0 stretch; border-width: 1.6px; border-bottom-style: solid; --_11qfq0e: solid;">SSRS</span> documents.

## Get Page Coordinates

FlexViewer exposes the `PagePointerEvent` through the `C1FlexViewerPane` class. The event is raised when the user interacts with a rendered document page using the mouse.
The event provides the `X` and `Y` coordinates of the pointer relative to the document page, based on the document's `MeasurementUnits`.

>type=note
> `PagePointerEvent` is available through the `C1FlexViewerPane` object, which can be accessed using the `C1FlexViewer.Pane` property.

## PagePointerEventArgs

The `PagePointerEventArgs` class provides information about the pointer interaction, including pointer position, page information, and mouse input details.

| @cols=1:Property | @cols=1:Type | @cols=1:Description |
| -------- | ---- | ----------- |
| @cols=1:@rows=1:`Page` | @cols=1:@rows=1:`C1Page` | @cols=1:@rows=1:Represents the document page where the interaction occurred. |
| @cols=1:@rows=1:`HitTestInfo` | @cols=1:@rows=1:`HitTestInfo` | @cols=1:@rows=1:Provides information about the specific location within the page. |
| @cols=1:@rows=1:`X` | @cols=1:@rows=1:`double` | @cols=1:@rows=1:Gets the X-coordinate relative to the page, expressed in the document's `MeasurementUnits`. |
| @cols=1:@rows=1:`Y` | @cols=1:@rows=1:`double` | @cols=1:@rows=1:Gets the Y-coordinate relative to the page, expressed in the document's `MeasurementUnits`. |
| @cols=1:@rows=1:`Button` | @cols=1:@rows=1:`MouseButtons` | @cols=1:@rows=1:Indicates the mouse button that triggered the event. |
| @cols=1:@rows=1:`Clicks` | @cols=1:@rows=1:`int` | @cols=1:@rows=1:Gets the number of mouse clicks associated with the event. |
| @cols=1:@rows=1:`DeltaSign` | @cols=1:@rows=1:`int` | @cols=1:@rows=1:Indicates the mouse wheel direction: `-1`, `0`, or `1`. |

## Use PagePointerEvent

To retrieve page coordinates, subscribe to the `PagePointerEvent` on the viewer pane. The returned `X` and `Y` values are expressed in the document's measurement units and can be converted to other unit types by using the `C1.Document.Unit.Convert` method.
The following example demonstrates how to retrieve the coordinates of a single left mouse click and convert the values to millimeters.

```auto
c1FlexViewer1.Pane.PagePointerEvent += (object sender, PagePointerEventArgs e) =>
{
    if (e.Button == MouseButtons.Left && e.Clicks == 1)
    {
        // e.X and e.Y are in the document's MeasurementUnits.
        // Convert to millimetres or any other unit as needed.
        var units = c1FlexViewer1.DocumentSource.Document.MeasurementUnits;
        double xMm = C1.Document.Unit.Convert(e.X, units, C1.Document.UnitTypeEnum.Mm);
        double yMm = C1.Document.Unit.Convert(e.Y, units, C1.Document.UnitTypeEnum.Mm);
    }
};
```


<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
