printing - Openseadragon: Adding options to download and print images? -
i'm using openseadragon display deep zoom images, , client wants there button download image , button print image, in addition regular nav items. there no premade buttons these functions in openseadragon, need create buttons manually. have no idea how this, can me?
i need to: (1) add new buttons viewer nav (2) create functions download , print current image.
(1) have similar functionality in our openseadragon (osd) site. made custom toolbar including default buttons , added our own buttons. binding of custom actions setup simple giving osd id of elements on init. binding of custom buttons made 'manually'. html code this:
<div id='viewertoolbar'> <!-- default buttons --> <div class='toolbaritem' id='pv_home'></div> <div class='toolbaritem' id='pv_zoom-in'></div> <div class='toolbaritem' id='pv_zoom-out'></div> <div class='toolbaritem' id='pv_full-page'></div> <!-- custom actions --> <div class='toolbaritem' id='customaction'>customaction</div> <div class='toolbaritem' id='customaction2'>customaction2</div> </div> osd setup this:
openseadragon({ id: 'viewer', tilesources: 'dzi_url' toolbar:'viewertoolbar', zoominbutton: 'pv_zoom-in', zoomoutbutton: 'pv_zoom-out', homebutton: 'pv_home', fullpagebutton: 'pv_full-page' }); custom button setup (jquery):
$( '#customaction' ).on( 'click', function() { //do custom action }); $( '#customaction2' ).on( 'click', function() { //do custom action 2 }); (2) created our own services generate pdf download user can print which. think easier , gives more reliable result trying print/download osd. run issues like: printing done current zoom level; resolution issues; have wait until tiles loaded before creating png downlaod etc.
Comments
Post a Comment