I replaced it with your code but it now no longer works - image attached.
I replaced this code: 
 pre 
 var canvas = jQuery("#signature_pad")[0]; 
 if(!canvas) 
     alert("Here is no #signature_pad element on the page"); 
 else 
     var signaturePad = new SignaturePad(canvas); 
 /pre
with your one: 
 pre 
 //htmlsigpad is name of html component 
 var canvas = Apperyio("htmlsigpad").find("canvas"); 
 var content = jQuery('[data-role="content"]'); 
 var height = content.height(); 
 var width = content.innerWidth() - 40; 
 console.log("height = " + height); 
 canvas.attr("height", height); 
 canvas.attr("width", width); 
 var canvas = jQuery("#signature_pad")[0]; 
 if(!canvas) 
     alert("Here is no #signature_pad element on the page"); 
 else 
     var signaturePad = new SignaturePad(canvas); 
 /pre
