eKoopmans/html2pdf.js

How to compress PNG images using canvas-png-compression shim?

simixmc opened this issue · 0 comments

How to compress PNG images using canvas-png-compression shim?

The description says that it is possible, but how to do it is not clear.

const element = getIframeContent('data-frame'); const opt = { margin: 0, filename: '<?=$this->input->get('id');?>.pdf', pagebreak: { mode: 'css', after: '.break-point' }, image: { type: 'png'}, enableLinks: false, html2canvas: { dpi: 192, scale: 1, scrollX: 0, scrollY: 0, backgroundColor: '#ffc52f', letterRendering: true, }, jsPDF: { unit: 'mm', format: 'a4', putOnlyUsedFonts: true, orientation: 'portrait', compress: true, precision: 8, marginLeft: 0, marginTop: 0, marginBottom: 0, marginRight:0, backgroundColor: '#ffc52f', floatPrecision:'smart' }, noPdfOpenParams: true }; html2pdf().set(opt).from(element).save();