# Interface ICustomHighlight

Represents a custom highlight within a document.

#### Hierarchy

- ICustomHighlight

#####
Index

### Properties

borderColor
borderWidth
color
paintHandler
rects
text

## Properties

### `Optional` borderColor

borderColor?: string

The color of the highlight border in `rgba`, `hex`, or named color format. If not specified, defaults to 'rgba(255, 165, 0, 0.75)'.

### `Optional` borderWidth

borderWidth?: number

The width of the highlight border in pixels. If not specified, defaults to 2 pixels.

### `Optional` color

color?: string

The fill color of the highlight in `rgba`, `hex`, or named color format. If not specified, defaults to 'rgba(255, 255, 0, 0.5)'.

### `Optional` paintHandler

paintHandler?: ((ctx: CanvasRenderingContext2D, highlight: ICustomHighlight) => void)

#### Type declaration

- - (ctx: CanvasRenderingContext2D, highlight: ICustomHighlight): void

  - A custom function to handle the painting of the highlight.

    #### Parameters

    - ##### ctx: CanvasRenderingContext2D

      The rendering context of the canvas to draw on.

    - ##### highlight: ICustomHighlight

      The highlight object containing details for painting.

    #### Returns void

### rects

rects: (number[] | { h: number; w: number; x: number; y: number })[]

An array of rectangles that specify the position and dimensions of the highlight areas on the page. Each rectangle can be defined in one of two formats:

1. Object format:

   - `{ x: number, y: number, w: number, h: number }`
   - `x` and `y` represent the coordinates of the rectangle's bottom-left corner.
   - `w` (width) represents the horizontal size of the rectangle, extending to the right from `x`.
   - `h` (height) represents the vertical size of the rectangle, extending upwards from `y`.

2. Array format:

   - `[x1: number, y1: number, x2: number, y2: number]`
   - `x1` and `y1` represent the coordinates of the rectangle's bottom-left corner.
   - `x2` and `y2` represent the coordinates of the rectangle's top-right corner.

Coordinate System:

- The coordinate system's origin (0, 0) is at the bottom-left corner of the page.
- Coordinates `x` and `y` increase to the right and upwards, respectively.
- Width (`w`) extends to the right from the `x` position, and height (`h`) extends upwards from the `y` position.
- All measurements (x, y, w, h) are in pdf points (pt).

### `Optional` text

text?: string

The text content associated with the highlight.