I'm using Open Seadragon to display deep zoom images on a page. I want to include a link to download the image. I have it mostly working, except the image that gets downloaded is blank.
Here is my fiddle
Here is the code I'm using
function seadragon(){
var url = "http://26.img.americanancestors.org/8e09e1f1-e1e9-4414-a0f5-86a6f09454a2.xml";
var viewer = OpenSeadragon({
id: "databaseviewer",
prefixUrl: "../../Scripts/openseadragon/images/",
tileSources: url,
maxZoomLevel: 20
});
viewer.addHandler('open', function() {
var img = viewer.drawer.canvas.toDataURL("image/png");
console.log(img);
var downloadlink = document.getElementById("download");
downloadlink.href = img;
downloadlink.download = 'SeadragonImage';
});
}
seadragon();