Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove grey color line from CANVAS in the jSignature plugin?

How to remove grey color line from CANVAS (Signature panel) in the jSignature plugin ?

Is there any option to validate whether user enter signature or not ? Any built in function for this ?

http://willowsystems.github.com/jSignature/#/demo/

like image 928
Sahal Avatar asked Nov 30 '22 02:11

Sahal


2 Answers

How about this setting the decor-color to transparent

$(document).ready(function() {
        $("#signature").jSignature({
            'background-color': 'transparent',
            'decor-color': 'transparent',
        });
    });
like image 50
Joshua Cave Avatar answered Dec 15 '22 09:12

Joshua Cave


I am afraid there is no option to turn it off, so the only solution would be to change the plug-in code itself

There is a section in the plug-in that draws the base line. Just comment out like this

// signature line
ctx.strokeStyle = settings['decor-color']
ctx.shadowOffsetX = 0
ctx.shadowOffsetY = 0
var lineoffset = Math.round( ch / 5 )
//basicLine(ctx, lineoffset * 1.5, ch - lineoffset, cw - (lineoffset * 1.5), ch - lineoffset)
ctx.strokeStyle = settings.color
like image 44
devnull69 Avatar answered Dec 15 '22 08:12

devnull69