Document Solutions Image Viewer
    Preparing search index...

    Type Alias ToolsOptions

    Default visual properties applied to each paint and object tool when the toolbar opens.

    All values are optional, omitted properties fall back to the built-in defaults. User interactions during a session override these values and are persisted in localStorage.

    Shape properties (lineWidth, lineColor, fillColor) define the initial style for newly created Rectangle, Line, Arrow, Ellipse, and Brackets objects.

    PaintToolsPluginOptions.toolsOptions

    viewer.addPlugin(new PaintToolsPlugin({
    tools: {
    penSize: 2,
    penColor: '#e03030',
    brushSize: 20,
    brushHardness: 50,
    eraserSize: 30,
    lineWidth: 2,
    lineColor: '#0055cc',
    objects: {
    text: { fontSize: 16, fontColor: '#222222', fontName: 'Arial', fontBold: true },
    rectangle: { fillColor: 'transparent', borderRadius: 4 },
    line: { endCapStyle: 'closedArrow', capSize: 12 },
    },
    }
    }));
    type ToolsOptions = {
        penSize: number;
        penColor: string;
        penOpacity: number;
        brushSize: number;
        brushColor: string;
        brushHardness: number;
        brushOpacity: number;
        cloneStampSize: number;
        cloneStampOpacity: number;
        cloneStampHardness: number;
        eraserSize: number;
        eraserOpacity: number;
        eraserHardness: number;
        lineWidth: number;
        lineColor: string;
        fillColor: string;
        objects?: ToolsObjectsOptions;
    }

    Properties

    penSize: number

    Pencil stroke width in pixels.

    1
    
    penColor: string

    Pencil stroke color.

    '#000000'
    
    penOpacity: number

    Pencil stroke opacity as a percentage (0–100).

    100
    
    brushSize: number

    Brush stroke width in pixels.

    12
    
    brushColor: string

    Brush stroke color.

    '#000000'
    
    brushHardness: number

    Brush edge hardness as a percentage (0–100). Lower values produce a soft airbrush effect; higher values produce hard edges.

    70
    
    brushOpacity: number

    Brush stroke opacity as a percentage (0–100).

    100
    
    cloneStampSize: number

    Clone Stamp brush width in pixels.

    60
    
    cloneStampOpacity: number

    Clone Stamp opacity as a percentage (0–100).

    100
    
    cloneStampHardness: number

    Clone Stamp edge hardness as a percentage (0–100).

    70
    
    eraserSize: number

    Eraser brush width in pixels.

    12
    
    eraserOpacity: number

    Eraser opacity as a percentage (0–100).

    100
    
    eraserHardness: number

    Eraser edge hardness as a percentage (0–100).

    70
    
    lineWidth: number

    Default stroke width in pixels for shape objects (Rectangle, Line, Arrow, Ellipse, Brackets).

    1
    
    lineColor: string

    Default stroke color for shape objects.

    '#000000'
    
    fillColor: string

    Default fill color for shape objects. Use 'transparent' or a color with zero alpha to draw unfilled (outline-only) shapes.

    'transparent'
    

    Default style overrides for all paint objects. Allows control over the initial appearance of each object type. Values specified here override lineWidth, lineColor, and fillColor for that specific type.