0

This is a script from my jsignature code

i want to get the image data and pass it as a php value to be sent as an pdf email

but i don't know how to put the output of the code to be included in the form.

<script>
$(document).ready(function() {

    // This is the part where jSignature is initialized.
    var $sigdiv = $("#signature").jSignature({'UndoButton':false,'width':200,'height':100}), $tools =    $('#tools') // {'width':300,'height':300}

$('#erase').bind('click', function(e){
    $sigdiv.jSignature('reset')
})

$('#create').bind('click', function(e){
    var datapair = $sigdiv.jSignature("getData", "image") 
    var i = new Image()
    i.src = "data:" + datapair[0] + "," + datapair[1] 
    $('#displayarea2').empty();
$(i).appendTo($("#displayarea2")); // append the image (SVG) to DOM.

 })

</script>

i guess i want to try what he did

jSignature image export to PHP email

but don't know how to produce the same results.

Community
  • 1
  • 1
Link
  • 303
  • 1
  • 5
  • 13
  • Depending on the encoded image data specified in `datapair[0]`, it can be *URI* encoded or *Base64* encoded (as a string). But for binary data, they are usually encoded in *Base64*. You might be able to simply use `datapair[1]` as a *Base64* encoded image data. – Jay Aug 27 '12 at 12:36
  • how can i do that ? what value or proceedure should i use? sorry for asking to many questions i'm still a beginner at this. if it's not to much to ask could you give me a demo? – Link Aug 28 '12 at 00:05

0 Answers0