SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="signArea" >
  2.     <h2 class="tag-ingo">Put signature below,</h2>
  3.  <div class="sig sigWrapper" style="height:auto;">
  4.     <div class="typed"></div>
  5.  <canvas class="sign-pad" id="sign-pad" width="300" height="100">
  6. </canvas>
  7.         </div>
  8.     </div>
  9.     <button id="btnSaveSign">Save Signature</button>
  10.      
  11. $(document).ready(function() {
  12.          $('#signArea').signaturePad({drawOnly:true,
  13. drawBezierCurves:true, lineTop:90});
  14.         });
  15.  
  16.         $("#btnSaveSign").click(function(e){
  17.         html2canvas([document.getElementById('sign-pad')], {
  18.       onrendered: function (canvas) {var canvas_img_data =
  19.           canvas.toDataURL('image/png');
  20.        var img_data =
  21.          canvas_img_data.replace(/^data:image/(png|jpg);base64,/, "");
  22.    //ajax call to save image inside folder
  23. $.ajax({
  24. url: 'save_sign.php',
  25. data: { img_data:img_data },
  26.     type: 'post',
  27.      dataType: 'json',
  28. success: function (response) {
  29. window.location.reload();
  30.     }});}});});
  31.  
  32.  
  33.  the output loads like this  
  34.  
  35.    <?php $image_list = glob("doc_signs/*.png");
  36.     foreach($image_list as $image){ ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top