ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

help with Signiture Pad

phil2010 22 Apr, 2017
I need help with embedding a captured signature into a pdf

any takers?

https://www.skin.com.au/services/referral-form-westmead?view=form
phil2010 22 Apr, 2017
Answer
Not to worry, I sat down and realized I was just being lazy and worked it out... Thanks Bob for making my common sense.
healyhatman 16 Aug, 2017
If anyone else wants to know:
You first need to save the signature as a PNG. Put this in a PHP code action.

//$img: base64 encoded png
//$fileName: what you want the generated image to be called
function saveSignature($img, $fileName)
{
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);

file_put_contents("path/to/the/{$fileName}", $data);
}

// Get the fileNameGenerator string to name the signature file with
saveSignature($this->data('signature field', ''), "what you want it called.png");
GreyHead 16 Aug, 2017
Hi Phil,

This FAQ might have helped a bit - it is similar to your code I think but creates the file info in the same structure as CF.

Bob
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com