react-pdf-highlighter-plus

The props type for DrawingCanvas.

interface DrawingCanvasProps {
    isActive: boolean;
    onCancel: (() => void);
    onComplete: ((dataUrl, position, strokes) => void);
    strokeColor?: string;
    strokeWidth?: number;
    viewer: PDFViewer;
}

Properties

isActive: boolean

Whether drawing mode is active.

onCancel: (() => void)

Callback when drawing is cancelled.

Type declaration

    • (): void
    • Returns void

onComplete: ((dataUrl, position, strokes) => void)

Callback when drawing is complete.

Type declaration

    • (dataUrl, position, strokes): void
    • Parameters

      • dataUrl: string

        The drawing as a PNG data URL.

      • position: ScaledPosition

        Scaled position of the drawing on the page.

      • strokes: DrawingStroke[]

        The stroke data for later editing.

      Returns void

strokeColor?: string

Stroke color for drawing.

Default

"#000000"
strokeWidth?: number

Stroke width for drawing.

Default

3
viewer: PDFViewer

The PDF viewer instance.