Código PHP:
// Generate the signature image
function generateImage() {
var saveImageCanvas = document.createElement("canvas");
saveImageCanvas.width = canvas.width;
saveImageCanvas.height = canvas.height;
var ctx = saveImageCanvas.getContext("2d");
ctx.lineWidth = 1;
ctx.strokeStyle = 'black';
ctx.font="30px Arial";
ctx.fillStyle="white";
ctx.fillRect(0,0,canvas.width,canvas.height);
ctx.beginPath();
for (var i = 1; i < m_penData.length; i++) {
// Draw a line from the previous down point to this down point.
// This is the simplist thing you can do; a more sophisticated program
// can perform higher quality rendering than this!
var prev = tabletToScreen(m_penData[i - 1]);
var act = tabletToScreen(m_penData[i]);
if (m_penData[i].sw == 1) {
ctx.moveTo(prev.x, prev.y);
ctx.lineTo(act.x, act.y);
}
}
ctx.closePath();
ctx.stroke();
preview.src = saveImageCanvas.toDataURL("image/png");
}
Alguna ayuda
Gracias