Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
Signature Pad ToDataURL no funciona para firmas complejas

Estoy usando el pad de firma hecho por szimek ( https://github.com/szimek/signature_pad ), con el que no tengo problemas para obtener la URL de datos.

ingrese la descripción de la imagen aquí

Sin embargo, cuando dibujo muchas líneas en el lienzo, la URL devuelta por toDataURL() da como resultado un error que indica que no se puede acceder al sitio. ingrese la descripción de la imagen aquí

¿Puede alguien indicarme el camino correcto? Lo que posiblemente se pudo haber hecho mal

---EDIT--- Después de seguir la sugerencia hecha por @Sourabh Kumar

 var signatureDataURL = objOfSignaturePads[manual_ticket_id].toDataURL('image/jpeg');

Ahora puedo acceder a la URL de datos sin encontrar ningún error; sin embargo, las firmas están cortadas con un área gris adjunta debajo

ingrese la descripción de la imagen aquí

Código

 var fd = new FormData(); function getTicketFieldDataForSubmission(manual_ticket_id, fd){ $( "#manual-complexform-fields-container"+manual_ticket_id ).children('textarea,select,input,.m-signature-pad').each(function (index, ele) { // if(jQuery(ele).attr('type')!='file'){ // console.log("MADE IN IN HERE123"); // console.log(jQuery(ele)); // fd.append(jQuery(ele).attr('name'),jQuery(ele).val()); // } if(jQuery(ele).attr('class')=='m-signature-pad'){ console.log('FOUND M SIGNATURE PAD'); if(objOfSignaturePads.hasOwnProperty(manual_ticket_id)) { console.log(manual_ticket_id); console.log(objOfSignaturePads); var signatureDataURL = objOfSignaturePads[manual_ticket_id].toDataURL('image/png'); fd.append('signature_data',signatureDataURL); } } else{ fd.append(jQuery(ele).attr('name'),jQuery(ele).val()); } }); enter code here
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Use este .toDataURL("imagen/png");

Agregue este css para establecer la altura y el ancho del panel de firma

 .signature-pad{ height: *your_preffered_value* px !important; width: *your_preffered_value* px !important; }

¡He usado !important para anular el CSS existente!

about 4 years ago · Juan Pablo Isaza Report

0

Después de más pruebas, encontré el error debido a que el tamaño de la URL convertida a DataURL excedió la longitud máxima permitida del tipo de campo de texto mySQL de 65,535 caracteres.

Cambiar el tipo de campo a texto medio funcionó para mí.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!