I'm trying to use the fromHTML function of jsPDF in a Vue project and I don't know how to import the key plugin which is fromHTML.
I'm importing per the docs: import { jsPDF } from "jspdf"; but I don't know how to correctly import the fromHTML function. I'd rather not use script tags.
My print method looks like this:
handleSavePdf() {
const doc = new jsPDF("p", "in", "letter");
doc.fromHTML(this.html, 0.5, 0.5, { // fromHTML not a function
width: 7.5,
});
doc.save(`${this.itemDetails.fields["Inventory No."]}.pdf`);
},
Thoughts?