Socket
Socket
Sign inDemoInstall

@mescius/dsimageviewer

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mescius/dsimageviewer

Document Solutions Image Viewer


Version published
Weekly downloads
13
decreased by-81.69%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Document Solutions Image Viewer

A JavaScript Image viewer and editor that comes with Document Solutions for Imaging.

Document Solutions Image Viewer (DsImageViewer) is a fast modern JavaScript based image viewer and editor that runs in all major browsers. The viewer can be used as a cross platform solution to view or modify images on Windows, MAC, Linux, iOS and Android devices. DsImageViewer is included in Document Solutions for Imaging (DsImaging), a feature-rich cross-platform Image API library for .NET.

DsImageViewer provides a rich client side JavaScript object model, see docs/index.html for the client API documentation.

Product highlights:

  • Works in all modern browsers including IE11, Edge, Chrome, FireFox, Opera, Safari.
  • Works with pure JavaScript and frameworks such as Angular, Vue, ASP.NET Core, ASP.NET MVC, HTML5, React and Preact.
  • Allows you to extend the viewer behavior and add new functionality using plug-ins.
  • Provides a client API for creating and modifying image data.
  • Supports raster image formats JPEG, PNG, WEBP, TIFF, GIF, BMP, ICO, and vector SVG format.
  • ...and more.

See it in action

  • Go to Document Solutions Image Viewer demos to explore the various features of DsImageViewer. The demo site allows you to modify the demo code and immediately see the effect of your changes.
  • The Document Solutions for Imaging demos can optionally use DsImageViewer to show the sample images (to opt in or out of using DsImageViewer, click the blue "i(nformation)" icon in the top right corner of the image preview panel).

Latest changes

Important note

The @mescius/dsimageviewer package replaces @grapecity/gcimageviewer, and provides the same functionality, ensures future enhancements, and is backwards compatible with @grapecity/gcimageviewer. Existing licenses will continue to work with DsImageViewer.

[7.1.1] - 23-Apr-2024

Added

  • [PaintTools] Added toolbarLayout option to the PaintTools plugin. (DOC-6174)
// Example 1 - modify paint tools toolbar:
viewer.addPlugin(new PaintToolsPlugin({
toolbarLayout: {
		paintTools: ["Pencil", "Size", "Color", "Splitter", "Apply", "Cancel"]
}
}));
// Example 2 - modify text tools toolbar:
viewer.addPlugin(new PaintToolsPlugin({
toolbarLayout: {
		textTools:  ["Text", "FontSize", "Splitter", "Apply", "Cancel"]
}
}));

[7.1.0] - 04-Apr-2024

Added

  • 'Save As' dropdown menu added to the 'Save' button, providing the ability to convert the image to another format. (DOC-5799).
    The supported formats for conversion include: PNG (image/png), JPEG (image/jpeg), WEBP (image/webp), BMP image/bmp, GIF (image/gif). Note that WEBP may not be supported on certain platforms, such as Safari for Mac or iOS. In such cases the 'Save as WEBP' menu item will be hidden.
  • The save method has been enhanced to include the ability to specify save options, allowing you to customize the saving process, including changing the image format via the convertToFormat option.
    // Example: save the modified image as PNG:
    const viewer = DsImageViewer.findControl("#root");
    viewer.save({ convertToFormat: "image/png" });
    

See CHANGELOG.​md for previous release notes.

Installing and using the viewer

Installing from npmjs:

npm install @mescius/dsimageviewer

Installing from the zip archive:

The following viewer distribution files are located in the zip archive:

  • build/README.md (this file)
  • build/CHANGELOG.md
  • build/index.html
  • build/dsimageviewer.js
  • build/plugins/ (optional) Plugins
  • build/themes/ (optional) Theme files
  • build/typings/ (optional) Type definitions

Copy those files to an appropriate location accessible from the web page where the viewer will live, e.g. if the files are put in the directory where the web page is, the following HTML can be used to show the viewer:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="theme-color" content="#000000" />
    <title>Document Solutions Image Viewer Demo</title>
    <script src="dsimageviewer.js"></script>
    <script src="plugins/rotation.js"></script>
    <script>
      function loadImageViewer(selector) {
        var viewer = new DsImageViewer(selector);
        viewer.addPlugin(new RotationPlugin());
      }
    </script>	
  </head>
  <body onload="loadImageViewer('#root')">
    <div id="root"></div>
  </body>
</html>

The End.

Keywords

FAQs

Last updated on 24 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc