I have in my page a signature pad where the user can make an electronic signature. I am using js librairy SignaturePad(https://github.com/szimek/signature_pad).
My signature pad background color is black so I have set my stroke color to white. After saving the signature in my DB you have the option to print a report with the signature in it but this time the background is white.
My problem is that since the user is signing in white when you try to print the report, you can't see the signature since it's white on white.
Does anybody have an idea on how i could like change the signature color to white using css or other method to keep the default color(black) when im saving the signature in my DB ?
The
penColor
is saved on the points/url when you save the signature.You can use
getData()
to get all the points, then useforEach()
to loop over them and change thepenColor
accordingly.The
backgroundColor
can be changed on run-time as desiredDemo:
backgroundColor: 'black'
andpenColor: 'white'
backgroundColor
is set towhite
penColor
as described abovefromData