Plugin for openseadragon, which allows you to make a screenshot of your current viewport, with a user specified resolution.
JavaScript
Latest commit f0c5169 Sep 29, 2016 koen griffioen removed unnecessary files
Permalink
Failed to load latest commit information.
README.md Fixed bugs, first actual working commit Sep 29, 2016
openseadragonScreenshot.js Fixed bugs, first actual working commit Sep 29, 2016
openseadragonScreenshot.min.js

README.md

Openseadragon-screenshot

This is a plugin for the openseadragon viewer that allows you to take a screenshot of whatever it is you are looking at in the browser. It includes an optional menu.

Wanna see it in action?

https://ktgleiden.github.io/openseadragon-screenshot/

Worthy to note

This plugin will work with the master branch of openseadragon (no stable release yet). If you need it to work with older versions, the only thing is that This commit is needed, since the viewer has to wait until the image has loaded completely, until we make the screenshot. This will most probably be included in the next stable release, but if you just can't wait: add the code manually ;)

Installation instructions

  • Download openseadragon-screenshot.js
  • Download Filesaver.js, which I am using for creating the screenshot and downloading it.
    • Note: Filesaver.js has another dependency, which adds the .ToBlob() method for IE. If you want IE support, also download this! Canvas-toBlob.js
  • Use the following code to add a button to make a screenshot:
    // viewer will be your OpenSeaDragon viewer object
    viewer.screenshot({
        showOptions: true, // Default is false
        keyboardShortcut: 'p', // Default is null
        showScreenshotControl: true // Default is true

    });

Troubleshooting

If this plugin reports that "your canvas is tainted" and it cannot export it in that case, please initialize the viewer object with the following parameter:

    var viewer = Openseadragon({
        ...,
        crossOriginPolicy: "Anonymous"
    })