JsPDF generates a blank PDF

I am using: jsPDF to generate pdf from html in the server side I have … Read more JsPDF generates a blank PDF

I am using: jsPDF to generate pdf from html in the server side

I have installed the following packages:

"html2canvas": "^1.3.2",
"jspdf": "^2.3.1",

makePdf.ts

const { jsPDF } = require("jspdf");  
const doc = new jsPDF();
  
doc.html('<p>Hola Mundo!</p>');
doc.save("export.pdf");

The issue is I am getting a blank pdf document and I don’t know how to fix this issue.

When I write a plain text (i.e doc.text(‘Hola Mundo!’, 10, 10)) it works fine.

Source: JavaSript – Stack Overflow


Categories: NewsTags: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *