html2pdf.js icon indicating copy to clipboard operation
html2pdf.js copied to clipboard

just render a new div call 'html2pdf__overlay', but not output as a pdf

Open Tiramisupxl opened this issue 2 years ago • 0 comments

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

Tiramisupxl avatar Mar 18 '22 02:03 Tiramisupxl