javascript - Opening pdf in new tab using a png image with jspdf works in Mozilla, but not Chrome or Internet Explorer -


i create flot graph on html website , want able export pdf (on click of button) should open in new tab, people decide if want download computers or not.

i started jpeg , working fine, background appears black because of transparency issues, changed png.

after code crashes chrome browser, or opens new empty tab! same internet explorer... in mozilla seems work fine. saving pdf file rather opening in new window works perfect in browsers, i'd rather not fill people's download folders junk may not want.

i created fiddle reproduce issue: http://jsfiddle.net/8tlt9yof/10/

jquery code inside "get pdf" button reads (plot name of flot graph):

var canvas = plot.getcanvas(); var src = canvas.todataurl("image/png"); var doc = new jspdf('landscape'); doc.addimage(src, 'png', 10, 20, 280, 150); doc.output('dataurlnewwindow'); 

can me see i'm doing wrong?


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -