CaptainCasa framework: TOUCHSIGNATURE component output as image/png data

Viewed 53

Do we have the option to get TOUCHSIGNATURE output as image/png ? We want to be able to embed the signature in different documents (pdf, html, markdown, etc...) and a png image will give us the most flexibility.

It should be relatively simple to implement on the frontend, since html canvas is used.

canvasElement.toDataUrl()

It will save us allot of hassle trying to convert those pixel coordinates to an image.

1 Answers

there is a class SignatureImageCreator (package org.eclnt.util.image) which exactly does this job.

Just call its method:

public static byte[] createPNGFromSignature(String coordinatesCSV)

The result is a byte-array representing the PNG-image.

Related