javascript - Printing a webpage with canvas -
i using canvas on project working on allow users add signature. having hard time printing canvas signature out on paper. using google chrome, canvas appears nicely in print preview, not appear @ on printed out paper.
i read in cases using todataurl
, replacing canvas area image, solves printout problem. however, in case, doing did not solve problem. wondering if there alternate solution issue.
i appreciate advice.
many in advance!
this tried:
var sktch = $('#simple_sketch').sketch(); var cleancanvas = $('#simple_sketch')[0]; $('.save-signature').click(function(){ /* replace canvas image */ var canvas = document.getelementbyid("simple_sketch"); var img = canvas.todataurl("image/png"); $('.signature-buttons').replacewith(''); document.getelementbyid("signature").value = document.getelementbyid("simple_sketch").todataurl("image/png"); $('#simple_sketch').replacewith('<img style="border-bottom:2px solid black;" src="'+img+'"/>'); });
Comments
Post a Comment