Open Rameshck opened 6 years ago
Hi Team,
Need immediate assistance that html2canvas is not working in angular 2 production external environment . the same logic works in local & uat.
Application itself not rendering . If i remove html2canvas atleast application is working but pdf functionality not working.
Logic which i did 👍
Code 👍 html2pdf(element, {
margin: 1, filename: vzeid+'.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { dpi: 192, letterRendering: true,width: element.clientWidth+400, height:element.clientHeight+100 }, jsPDF: { unit: 'pt', format: [element.clientWidth, element.clientHeight], orientation: 'p'} }); }
Thanks in advance !!!!
Hi, We are using npm html2canvas to convert html to pdf. PDF is not rendering external image. My code :
html2canvas(document.getElementById('chartView'), {useCORS : true,logging:true }).then(function(canvas) { var img = canvas.toDataURL("image/png"); var doc = new jsPDF(); doc.addImage(img,'JPEG',0,0); doc.save('test.pdf');
Any suggestion please