[]
Represents a custom highlight within a document.
optional 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: number;
The width of the highlight border in pixels. If not specified, defaults to 2 pixels.
optional 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: (ctx, highlight) => void;
A custom function to handle the painting of the highlight.
CanvasRenderingContext2D
The rendering context of the canvas to draw on.
ICustomHighlight
The highlight object containing details for painting.
void
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:
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.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:
x and y increase to the right and upwards, respectively.w) extends to the right from the x position, and height (h) extends upwards from the y position.optional text: string;
The text content associated with the highlight.