Ver Mensaje Individual
  #6 (permalink)  
Antiguo 01/12/2013, 15:29
quieropaginaweb
 
Fecha de Ingreso: noviembre-2012
Mensajes: 73
Antigüedad: 12 años
Puntos: 1
Respuesta: Pasar ImageBase64 a jpg

Es es el código javascript,
Código HTML:
 <script type="text/javascript">
    <!--
      function Capture() {
        try {
          print("Capturing signature...");
          var sigCtl = document.getElementById("sigCtl1");
          var dc = new ActiveXObject("Florentis.DynamicCapture");
          var rc = dc.Capture(sigCtl, "who", "why");
          if(rc != 0 )
            print("Capture returned: " + rc);
          switch( rc ) {
            case 0: // CaptureOK
              print("Signature captured successfully");
              break;
            case 1: // CaptureCancel
              print("Signature capture cancelled");
              break;
            case 100: // CapturePadError
              print("No capture service available");
              break;
            case 101: // CaptureError
              print("Tablet Error");
              break;
            case 102: // CaptureIntegrityKeyInvalid
              print("The integrity key parameter is invalid (obsolete)");
              break;
            case 103: // CaptureNotLicensed
              print("No valid Signature Capture licence found");
              break;
            case 200: // CaptureAbort
              print("Error - unable to parse document contents");
              break;
            default: 
              print("Capture Error " + rc);
              break;
          }
        }
        catch(ex) {
          Exception("Capture() error: " + ex.message);
        }
      }

      function DisplaySignatureDetails() {
        try {
          var sigCtl = document.getElementById("sigCtl1");
          if (sigCtl.Signature.IsCaptured) {
            print("Signature Information:");
            print("  Name:   " + sigCtl.Signature.Who);
            print("  Date:   " + sigCtl.Signature.When);
            print("  Reason: " + sigCtl.Signature.Why);
          }
        }
        catch(ex) {
          Exception("DisplaySignatureDetails() error: " + ex.message);
        }
      }

      function AboutBox() {
        try {
          var sigCtl = document.getElementById("sigCtl1");
          sigCtl.AboutBox();
        }
        catch(ex) {
          Exception("About() error: " + ex.message);
        }
      }

      function Exception(txt) {
        print("Exception: " + txt);
      }
      function print(txt) {
        var txtDisplay = document.getElementById("txtDisplay");
        if(txt == "CLEAR" )
          txtDisplay.value = "";
        else {
          txtDisplay.value += txt + "\n";
          txtDisplay.scrollTop = txtDisplay.scrollHeight; // scroll to end
        }
      }

      function OnLoad() {
        try {
		  if( !("ActiveXObject" in window) ) {
            document.getElementById("not_ie_warning").style.display="block";
  		    return;
          }
          print("CLEAR");
          var sigCtl = document.getElementById("sigCtl1");
          sigCtl.Licence = "AgAZAPZTkH0EBVdhY29tClNESyBTYW1wbGUBAoECA2UA";
          sigCtl.BackStyle = 1;
          sigCtl.DisplayMode=0; // fit signature to control
          print("Checking components...");
          var sigcapt = new ActiveXObject('Florentis.DynamicCapture');  // force 'can't create object' error if components not yet installed
          print("DLL: flSigCOM.dll  v" +   sigCtl.GetProperty("Component_FileVersion") + " ok");
          print("DLL: flSigCapt.dll v" + sigcapt.GetProperty("Component_FileVersion") + " ok");
          print("Test application ready.");
          print("Press 'Start' to capture a signature.");
          print("Enable image display.");
          var imgCtl = document.getElementById("imgCtl1");
          imgCtl.Licence = "AgAaALzhGEUEBVdhY29tClNESyBTYW1wbGUBAoEDAQNlAA";
		  
  imgCtl.ImageBase64 = "/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAPABADASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD32WRI YnlldUjRSzMxwFA6kmsfSr661uYahGWg0oZ+zqVw9z/00bPRP7o6nqeMCsfXfB0+p+JEube5MOnX aBNTiDkecEIKgD36Hpxn1rsURY0VEUKqjAUDAA9KzTlKWqsl+J2zjRpUk4S5pSXb4e/zv+Gu70// 2Q==";
        }
        catch(ex) {
          Exception("OnLoad() error: " + ex.message);
        }
      }
    -->
    </script> 
Creo que debo publicarlo en el foro de javascript, si no es así lo lamento.