eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdf images are not visible in pdf

apoorv28 opened this issue · comments

async newExportToPdf(element: HTMLElement, pdfName: string, calculatedHeight) {
//var element = document.getElementById('exportthis');
element.style.display = 'block'
let options = {
margin: [22, 10, 15, 10], //top, left, buttom, right
filename: 'Gantt.pdf',
image: { type: 'jpeg', quality: 1 },
html2canvas: { scrollX: 0, scrollY: 0 },
jsPDF: { unit: 'pt', format: 'A4', orientation: 'portrait' },
}
setTimeout(function () {
html2pdf().from(element).set(options).to('pdf').get('pdf').save()
}, 50);
}
images in pdf is cropped , can anyone help with this?