In my nuxt project , i want to convert my page component to Pdf. I checked many samples and almost all use doc.fromHtml to convert it to pdf. but I take error because of doc.fromHTML. I could not solve any solution and i insist of using jsPdf library . Because it is always updated.
data() {
return {
margins : {
top: 80,
bottom: 60,
left: 40,
width: 522
}
}
},
methods: {
generatePdf() {
const doc = new jsPDF('p', 'pt', 'A4');
doc.fromHTML(this.$refs.testHtml, this.margins.left, this.margins.top,{
'width' : this.margins.width
});
doc.save('test.pdf');
}
}
question from:
https://stackoverflow.com/questions/65920205/convert-html-to-pdf-by-using-jspdf-in-nuxtjs-mistake-of-doc-fromhtml 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…