Foros del Web » Programando para Internet » Javascript »

Firma digital wacom

Estas en el tema de Firma digital wacom en el foro de Javascript en Foros del Web. Hola buenas tardes necesito saber si hay alguna forma de poder grabar la firma en un tabla de msql. Los codigos para descargar están en ...
  #1 (permalink)  
Antiguo 28/11/2013, 09:42
 
Fecha de Ingreso: noviembre-2012
Mensajes: 73
Antigüedad: 11 años, 5 meses
Puntos: 1
Firma digital wacom

Hola buenas tardes necesito saber si hay alguna forma de poder grabar la firma en un tabla de msql.
Los codigos para descargar están en esta dirección

http://gsdt.wacom.eu/support/STU-SDK-API-Samples.xml

El código del formulario es este:
Código PHP:
<!doctype html>
<
html>
  <
head>
    <
link rel="stylesheet" type="text/css" href="demoButtons.css" />
    <
script type="text/javascript" src="demobuttons.js"></script>
    <script type="text/javascript">
      function initDemo() {
        var signatureForm = new SignatureForm(document.getElementById("signatureImage"));
        signatureForm.connect();
      }
    </script>
  </head>
  <body>
    <div>
      <div id="signatureDiv">
        Signature image:<br/>
        <img id="signatureImage"/>
      </div>
      <div>
        Actions:<br/>         
        <input type="button" id="signButton" value="Start demo" onClick="javascript:initDemo()"/>
      </div>
    </div>
    <object id="wgssSTU" type="application/x-wgssSTU"></object>
  </body>
</html> 
El código del js, es este:
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 
1m_penData.lengthi++) {
      
// 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[1]);
      var 
act tabletToScreen(m_penData[i]);      
        
      if (
m_penData[i].sw == 1) {
        
ctx.moveTo(prev.xprev.y);
        
ctx.lineTo(act.xact.y);
      }  
    }
    
ctx.closePath();
    
ctx.stroke();
      
    
preview.src saveImageCanvas.toDataURL("image/jpeg");      
  }

  function 
close() {
    
document.getElementsByTagName('body')[0].removeChild(modalBackground);
    
document.getElementsByTagName('body')[0].removeChild(formDiv);
      
    
// Ensure that you correctly disconnect from the tablet, otherwise you are 
    // likely to get errors when wanting to connect a second time.
    
if (m_tablet != null) {
      
m_tablet.setInkingMode(0x00);
      
m_tablet.setClearScreen();
      
m_tablet.disconnect();
    }
  }

  function 
btnOk_Click() {
    
// You probably want to add additional processing here.
    
generateImage();
    
close();
  }

  function 
btnCancel_Click() {
    
// You probably want to add additional processing here.
    
close();
  }

  function 
btnClear_Click() {
    
// You probably want to add additional processing here.
    
if (m_penData.length 0) {
      
clearScreen();        
    }
  }

  function 
onCanvasClick(event) {      
    
// Enable the mouse to click on the simulated buttons that we have displayed.
      
    // Note that this can add some tricky logic into processing pen data
    // if the pen was down at the time of this click, especially if the pen was logically
    // also 'pressing' a button! This demo however ignores any that.
      
    
var posX event.pageX formDiv.offsetLeft;
    var 
posY event.pageY formDiv.offsetTop;
      
    for (var 
0m_btns.lengthi++) {
      if (
m_btns[i].Bounds.Contains(new Point(posXposY))) {
        
m_btns[i].Click();
        break;
      }
    }
  } 
Hay más código pero supera el límite del post.
He pensado que en la function btnOk_Click(), se podria llamar a una consulta de actualizacion de una base de datos, bueno no se si eso es posible.
Si alguien puede echarme una mano, gracias

Etiquetas: firma, formulario, html, input, js, wacom
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:52.