html2pdf.js
html2pdf.js copied to clipboard
just render a new div call 'html2pdf__overlay', but not output as a pdf
I used this in vue3. the code is
import * as html2pdf from 'html2pdf.js'
const opt = {
margin: 1,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
};
html2pdf().set(opt).from(printRef.value).save()
when I run, it will render a new div call 'html2pdf__overlay' and render the printRef html inside it, but it doesn't output as a pdf or download itself