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

113
Views
jsPDF convert sentence of tag p of html file to word in one column

I'm using jsPDF with my nuxt.js project where I fetch the html from API when the user clicks the Export button then converts the HTML to PDF before download. The HTML file that I got from API looks completely normal but after being converted with jsPDF and exporting out I didn't get the full sentence but rather a word by word in one column instead (like the image below). Could anyone please help me fine out where I did wrong. Bellow are my codes

HTML code

   <span
        class="btn"
        title="Export report"
        v-if="!isExporting"
        @click="exportReport"
        >Export Report</span
    >

Javascript

import html2canvas from "html2canvas";
import jsPDF from "jspdf";

downloadReport() {
    Service.getHTMLReport().then(response => {
        var doc = new jsPDF("p", "pt", "a4");
        let htmlFile = response;

        doc.html(htmlFile, {
        callback: function(pdf) {
            pdf.save("report.pdf");
        }
        });
    });
}

This is the HTML file I console from the response enter image description here

This is the PDF file after export out enter image description here

about 4 years ago · Juan Pablo Isaza
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!