react-pdf-highlighter-plus

A highlight that can be exported to PDF.

interface ExportableHighlight {
    backgroundColor?: string;
    color?: string;
    content?: {
        image?: string;
        shape?: ShapeData;
        text?: string;
    };
    fontFamily?: string;
    fontSize?: string;
    highlightColor?: string;
    highlightStyle?: "underline" | "highlight" | "strikethrough";
    id: string;
    position: ScaledPosition;
    shapeType?: "rectangle" | "circle" | "arrow";
    strokeColor?: string;
    strokeWidth?: number;
    type?: "text" | "area" | "freetext" | "image" | "drawing" | "shape";
}

Properties

backgroundColor?: string

Background color for freetext highlights

color?: string

Text color for freetext highlights

content?: {
    image?: string;
    shape?: ShapeData;
    text?: string;
}

Type declaration

  • Optional image?: string
  • Optional shape?: ShapeData
  • Optional text?: string
fontFamily?: string

Font family for freetext highlights (not used in export, Helvetica is always used)

fontSize?: string

Font size for freetext highlights

highlightColor?: string

Per-highlight color override (for text/area highlights)

highlightStyle?: "underline" | "highlight" | "strikethrough"

Style mode for text highlights: "highlight" (default), "underline", or "strikethrough"

id: string
position: ScaledPosition
shapeType?: "rectangle" | "circle" | "arrow"

Shape type for shape highlights

strokeColor?: string

Stroke color for shape highlights

strokeWidth?: number

Stroke width for shape highlights

type?: "text" | "area" | "freetext" | "image" | "drawing" | "shape"