Viewer client area background color.
Use this option to change the default SVG icons to custom ones.
Used when file name not available.
Specifies the Image file name, URL, or binary data to be loaded in the Viewer.
OptionalfontArray of the available font names.
[
{ value: 'Helv', name: 'Helvetica' },
{ value: 'HelveticaRegular', name: 'Helvetica-Oblique' },
{ value: 'HelveticaBold', name: 'Helvetica-Bold' },
{ value: 'HelveticaBoldItalic', name: 'Helvetica-BoldOblique' },
{ value: 'TimesRegular', name: 'Times-Roman' },
{ value: 'TimesItalic', name: 'Times-Italic' },
{ value: 'TimesBold', name: 'Times-Bold' },
{ value: 'TimesBoldItalic', name: 'Times-BoldItalic' },
{ value: 'CourierRegular', name: 'Courier' },
{ value: 'CourierItalic', name: 'Courier-Oblique' },
{ value: 'CourierBold', name: 'Courier-Bold' },
{ value: 'CourierBoldItalic', name: 'Courier-BoldOblique' },
{ value: 'Symbol', name: 'Symbol' }
]
GIF image format options.
const viewer = new DsImageViewer("#root", {
gifOptions: {
autoPlay: true, // start GIF animation automatically
cumulative: false, // disable cumulative frame rendering (clear previous frame appearance)
playOnClick: true, // play on click
playOnHover: false, // do not play on hover
speed: 2 // double the speed
}
});
The image quality to use for image formats that utilize lossy compression, such as JPEG and WEBP. The value should be a number between 0 and 1, where 0 represents the lowest quality and 1 represents the highest quality. If this option is not specified, the default value of 0.92 is used. Please note that this option exclusively affects image editing capabilities only.
Specifies whether to hide the toolbar.
User interface language. Note, in order to use the language option, you must specify the language option value during the viewer initialization phase.
Use the maxImageSize option to limit the allowed image size used by the edit actions.
The onInitialized handler will be called immediately after the viewer is instantiated.
Options for customizing the behavior and appearance of the "Save" button.
OptionalthemeUse theme option to change default viewer theme. Available built-in themes are: gc-blue, viewer, dark, dark-yellow, light, light-blue. Set this option to false if you want to disable theme loading - this can be helpful if you have already included theme css.
// Require built-in light theme:
const viewer = new DsImageViewer("#root", { theme: "light" });
// Load external light theme css using relative URL:
const viewer = new DsImageViewer("#root", { theme: "themes/light.css" });
Undo state storage options.
OptionalzoomZoom control options.
Default image open parameters.
Keyboard shortcuts.
Image Viewer options.
Example