# openseadragon-screenshot

> Plugin for openseadragon, which allows you to make a screenshot of your current viewport, with a user specified resolution.

Latest version **1.0.2** (published 2017-10-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install openseadragon-screenshot
pnpm add openseadragon-screenshot
yarn add openseadragon-screenshot
bun add openseadragon-screenshot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-10-06 |
| First published | 2017-10-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Koen Griffioen |
| Maintainers | bsavelev |
| Keywords | openseadragon, screenshot |

## Links

- npm: https://www.npmjs.com/package/openseadragon-screenshot
- Repository: https://github.com/bsavelev/Openseadragon-screenshot
- Homepage: https://github.com/bsavelev/Openseadragon-screenshot#readme
- Issues: https://github.com/bsavelev/Openseadragon-screenshot/issues
- npm.io page: https://npm.io/package/openseadragon-screenshot

## Recent versions

- 1.0.2 (latest) — 2017-10-06
- 1.0.1 — 2017-10-06
- 1.0.0 — 2017-10-06

## README

# 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](https://github.com/openseadragon/openseadragon/pull/837/commits/f1cdf906535262783a9a94cb2dcdd5362e47b55c) 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](https://github.com/eligrey/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](https://github.com/eligrey/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"
    })
```

---
_Source: https://npm.io/package/openseadragon-screenshot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
