# PdfPageInteractionMap

Dependency-free text-selection and hit-test projection for one rendered PDF page.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfPageInteractionMap.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L45)

**Modifiers**

sealed

Dependency-free text-selection and hit-test projection for one rendered PDF page. Coordinates use the visual page's top-left origin after CropBox and page rotation are applied.

## Inheritance

- object
- PdfPageInteractionMap

## Remarks

Visual coordinates are numeric physical points (1/72 inch), with a top-left origin after crop, rotation and /UserUnit scaling. Use the page coordinate mapping methods when calling native read/edit APIs.

## Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 4

- Method [PdfDocument.GetEditingInteractions](/api/pdf/officeimo-pdf-pdfdocument/#method-geteditinginteractions-int32)
- Method [PdfDocumentAnnotations.GetEditingInteractions](/api/pdf/officeimo-pdf-pdfdocumentannotations/#method-geteditinginteractions-int32)
- Method [PdfDocumentRenderer.Interactions](/api/pdf/officeimo-pdf-pdfdocumentrenderer/#method-interactions-int32-officeimo-pdf-pdfpageinteractionoptions-officeimo-pdf-pdfloadoptions)
- Method [PdfPageInteractionMap.Create](/api/pdf/officeimo-pdf-pdfpageinteractionmap/#method-create-byte-int32-officeimo-pdf-pdfpageinteractionoptions-officeimo-pdf-pdfloadoptions)

Filter members 

Show inherited

## Methods

`public static PdfPageInteractionMap Create(byte[] pdf, int pageNumber, PdfPageInteractionOptions? options = null, PdfLoadOptions? readOptions = null)` [#](#method-create-byte-int32-officeimo-pdf-pdfpageinteractionoptions-officeimo-pdf-pdfloadoptions)

[PdfPageInteractionMap.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L45)

Builds an interaction map from PDF bytes.

Parameters

**pdf byte[] required**

**pageNumber int required**

**options OfficeIMO.Pdf.PdfPageInteractionOptions? = null optional**

**readOptions OfficeIMO.Pdf.PdfLoadOptions? = null optional**

Returns

`PdfPageInteractionMap`

`public string GetSelectedText(double x1, double y1, double x2, double y2)` [#](#method-getselectedtext-double-double-double-double)

[PdfPageInteractionMap.cs:264](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L264)

Joins selected text elements in extraction order, with a space across a gap between words and a line break between lines where the text does not already contain one.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

Returns

`string`

`public static PdfTextBreak GetTextBreak(PdfPageInteractionRegion previous, PdfPageInteractionRegion next)` [#](#method-gettextbreak-officeimo-pdf-pdfpageinteractionregion-officeimo-pdf-pdfpageinteractionregion)

[PdfPageInteractionMap.Words.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.Words.cs#L24)

Classifies how next follows previous: touching, after a gap on the same line, or on another line. Words written as separate runs without space characters, such as an OCR text layer, are separated by gaps rather than by text.

Parameters

**previous OfficeIMO.Pdf.PdfPageInteractionRegion required**

**next OfficeIMO.Pdf.PdfPageInteractionRegion required**

Returns

`PdfTextBreak`

`public IReadOnlyList<PdfPageInteractionRegion> HitTest(double x, double y, double tolerance = 0)` [#](#method-hittest-double-double-double)

[PdfPageInteractionMap.cs:227](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L227)

Returns all regions containing a visual top-left page coordinate.

Parameters

**x double required**

**y double required**

**tolerance double = 0 optional**

Returns

`IReadOnlyList<PdfPageInteractionRegion>`

`public IReadOnlyList<PdfPageInteractionRegion> SelectText(double x1, double y1, double x2, double y2)` [#](#method-selecttext-double-double-double-double)

[PdfPageInteractionMap.cs:243](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L243)

Returns text elements whose quads intersect a visual top-left selection rectangle.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

Returns

`IReadOnlyList<PdfPageInteractionRegion>`

`public IReadOnlyList<PdfPageInteractionRegion> SelectWord(double x, double y, double tolerance = 0)` [#](#method-selectword-double-double-double)

[PdfPageInteractionMap.Words.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.Words.cs#L7)

Selects the contiguous non-whitespace text run at a visual page coordinate, without crossing a line or a gap between independent runs.

Parameters

**x double required**

**y double required**

**tolerance double = 0 optional**

Returns

`IReadOnlyList<PdfPageInteractionRegion>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int PageNumber { get; }` [#](#property-pagenumber)

[PdfPageInteractionMap.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L25)

One-based page number.

`public double Width { get; }` [#](#property-width)

[PdfPageInteractionMap.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L28)

Visual page width in PDF points after page rotation.

`public double Height { get; }` [#](#property-height)

[PdfPageInteractionMap.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L31)

Visual page height in PDF points after page rotation.

`public IReadOnlyList<PdfPageInteractionRegion> Regions { get; }` [#](#property-regions)

[PdfPageInteractionMap.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L34)

All text, image, link, annotation, and form-widget regions.

`public IReadOnlyList<PdfPageInteractionRegion> TextRegions { get; }` [#](#property-textregions)

[PdfPageInteractionMap.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Reading/Interaction/PdfPageInteractionMap.cs#L37)

Text-element regions in content extraction order.

<!-- PowerForge markdown artifact sha256:0C1B85D5F4C35B56B9333DAE41F123E0B23E32E8A83184633CE3E59070076121 -->
