MarvinKlein1508 / SignaturePad

A simple to use blazor component to draw custom signatures.
MIT License
72 stars 12 forks source link

Saving as different formats / Adding background colors #10

Closed clodewyks closed 1 year ago

clodewyks commented 1 year ago

We have recently upgraded our app to use your component instead of an old, outdated javascript option. Thank you for the great component.

The one item we are missing is the ability to save to jpg or add a background to the png, the reason for this requirement I believe is quite specific to our use case; using the image in crystal reports which does not support transparent png.

Using the old component which has dissapeared off github we could achieve this by setting it up as follows:

var pad = new SignaturePad(canvas, { backgroundColor: "rgb(255,255,255)" });

When rendering the signatures in crystal reports from this component, they show with a black background

image

Is there a way to add a white background to the signature?

MarvinKlein1508 commented 1 year ago

@clodewyks I've just published an update to the component now which allows you to set the background color. You can provide it within the SignaturePadOptions

You should be able to convert the base64 string to whatever format you'll need.

clodewyks commented 1 year ago

Thank you @MarvinKlein1508 , tested and deployed.

Thank you for the fast response