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

277
Views
Saving a PDF Document generated in js.PDF to a Django Project Directory

I currently create a PDF in Django using js.PDF that gets download to wherever the web browser directs it to on my local computer. I would like to instead have it saved in a directory in my Django project that is hosted in Pythonanywhere.(i.e. /home/abraner/ABS/absdatabase/pdfs) Below is my current JavaScript code.

Any suggestions would be appreciated.


async function generatePDF(){
    document.getElementById("downloadButton").innerHTML = "Currently downloading, please wait";
        var downloading = document.getElementById("whatToPrint");
        var doc = new jsPDF('1', 'pt');
            await html2canvas(downloading, {
            allowTaint: true,
            useCORS: true,
            width: 798
            }).then((canvas) => {
            doc.addImage(canvas.toDataURL("image/png"), 'PNG', 5, 5, 585, 800);
            })
            doc.save("Document.pdf");
    window.location.replace('../emailproposal');
}
about 4 years ago · Santiago Gelvez
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!