
Load Multiple Image Formats
DsImageViewer makes it easy to load and display multiple image formats in a consistent viewing experience with a JavaScript Image Viewer, whether the image is opened by a user through the toolbar or loaded programmatically through your application. End users can open images using the built-in Open document button in the toolbar, while developers can load images directly using the viewer.open() method on the DsImageViewer instance. The open method supports opening images from a string URL (such as a hosted JPEG or PNG) and can also accept binary image data for more advanced workflows like loading from an API response, database, or custom file system integration.
When opening an image from binary data, DsImageViewer requires the imageFormat option to be specified so the viewer can correctly interpret the input. The imageFormat option also doubles as a way to identify the format of the currently loaded image. Supported formats include JPEG (imageFormat: 1), PNG (2), TIFF (3), GIF (4), BMP (5), ICO (6), SVG (7), and WebP (8), with 0 representing an unknown format. This makes it easy to build robust applications that can display and process mixed image sources without requiring separate viewer components or format-specific handling logic.

