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

437
Views
Guarde PDF en una carpeta específica usando JSPDF (JavaScript) PHP

Estoy usando JSPDF para convertir HTML a pdf y quiero enviarlo por correo electrónico. Para eso, necesito almacenar el archivo en la carpeta. Pero no puedo almacenarlo en la carpeta porque "pdf.save('filename.pdf')" no ofrece la opción de ruta.

 function pdf_dowland (order_id) { var contentWidth = $("#invoice_wrapper").width(); var contentHeight = $("#invoice_wrapper").height(); var topLeftMargin = 20; var pdfWidth = contentWidth + (topLeftMargin * 2); var pdfHeight = (pdfWidth * 1.5) + (topLeftMargin * 2); var canvasImageWidth = contentWidth; var canvasImageHeight = contentHeight; var totalPDFPages = Math.ceil(contentHeight / pdfHeight) - 1; var pdf_name = 'teklif_formu_'+order_id; html2canvas($("#invoice_wrapper")[0], {allowTaint: true}).then(function (canvas) { canvas.getContext('2d'); var imgData = canvas.toDataURL("image/jpeg", 1.0); var pdf = new jsPDF('p', 'pt', [pdfWidth, pdfHeight]); pdf.addImage(imgData, 'JPG', topLeftMargin, topLeftMargin, canvasImageWidth, canvasImageHeight); for (var i = 1; i <= totalPDFPages; i++) { pdf.addPage(pdfWidth, pdfHeight); pdf.addImage(imgData, 'JPG', topLeftMargin, -(pdfHeight * i) + (topLeftMargin * 4), canvasImageWidth, canvasImageHeight); } pdf.save(pdf_name+".pdf"); }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No parece que esto sea posible con jspdf ya que usa FileSaver.js para guardar archivos : https://github.com/eligrey/FileSaver.js/issues/42

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!