OptionalbuttonThe position where the "Paint tools", "Text and Objects" and "Effects" buttons should be inserted in the main toolbar.
Use false or -1 to skip insertion.
Undefined means the position will be determined automatically.
OptionalfontArray of available font names.
OptionaltoolsSpecifies default visual properties for each paint and object tool.
These values override the built-in defaults when the toolbar opens for the first time.
They are superseded by values the user adjusts interactively during the session.
To change defaults after the viewer is initialized, set plugin.toolsOptions at runtime.
OptionaltoolbarOptional. Specifies the layout of the paint, effects and objects toolbar. Defaults:
Array of items for the effects tools toolbar.
Set to false if you want to hide this toolbar item.
Array of items for the paint tools toolbar.
Set to false if you want to hide this toolbar item.
Array of items for the text tools toolbar.
Array of items for the insert objects toolbar.
Set to false if you want to hide this toolbar item.
// Modify paint tools toolbar
viewer.addPlugin(new PaintToolsPlugin({
toolbarLayout: {
paintTools: ["Pencil", "Size", "Color", "Splitter", "Apply", "Cancel"]
}
}));
OptionalimageConfiguration for predefined images that can be inserted via the "ImageGallery" toolbar button.
// Simple array of image URLs
viewer.addPlugin(new PaintToolsPlugin({
imageGallery: [
'https://example.com/images/checkmark.png',
'https://example.com/images/cross.png',
'https://example.com/images/arrow-up.png'
]
}));
// Advanced configuration with labels and categories
viewer.addPlugin(new PaintToolsPlugin({
imageGallery: {
categories: [
{
name: "Annotations",
items: [
{ url: 'images/checkmark.png', label: 'Checkmark', width: 32, height: 32 },
{ url: 'images/cross.png', label: 'Cross mark', width: 32, height: 32 }
]
},
{
name: "Arrows",
items: [
{ url: 'images/arrow-up.png', label: 'Up arrow' },
{ url: 'images/arrow-down.png', label: 'Down arrow' }
]
}
]
}
}));
Options for the PaintToolsPlugin.