eKoopmans / html2pdf.js

Client-side HTML-to-PDF rendering using pure JS.
MIT License
4.14k stars 1.39k forks source link

Some background images missing in generated PDF using Edge browser! #303

Open dslas4ever opened 4 years ago

dslas4ever commented 4 years ago

Hello,

I am using html2pdf js to convert HTML document to pdf, it includes some background images as well, but after converting to pdf that pdf document has some missing background images, but this only happens when we download pdf through MS Edge browser, all other browsers background images working fine, Any solution for that issue? really appreciate your guidance to fix this issue,

expected result expected-result

Edge browser result edge-issue

//options code var opt = { margin: 0.2, filename: 'sample.pdf', image: { type: 'png', quality: 0.95 }, html2canvas: { scale: 2, useCORS: true }, jsPDF: { unit: 'in', format: 'A4', orientation: 'portrait' }, pagebreak: { mode: ['avoid-all', 'css', 'legacy'] } };

stay safe out there with this covid19 situation! hope it all turns out well! Thank you

gabriel-felipe commented 4 years ago

@dslas4ever I'm not the maintainer here, but I suspect your issue may have something to do with html2canvas, which this project heavily depends on, there are some issues related to rendering background images on edge there, I'd recommend you to check those out and see if any of those helps you.

Some potentially related issues are: https://github.com/niklasvh/html2canvas/issues/1688 https://github.com/niklasvh/html2canvas/issues/2167

Also the page with the list of issues filtered by "edge" https://github.com/niklasvh/html2canvas/issues?q=is%3Aissue+is%3Aopen+edge

If nothing works for you I recommend you opening a new issue there too. And if something works close this one pointing to the related solution :)

dslas4ever commented 4 years ago

@dslas4ever I'm not the maintainer here, but I suspect your issue may have something to do with html2canvas, which this project heavily depends on, there are some issues related to rendering background images on edge there, I'd recommend you to check those out and see if any of those helps you.

Some potentially related issues are: niklasvh/html2canvas#1688 niklasvh/html2canvas#2167

Also the page with the list of issues filtered by "edge" https://github.com/niklasvh/html2canvas/issues?q=is%3Aissue+is%3Aopen+edge

If nothing works for you I recommend you opening a new issue there too. And if something works close this one pointing to the related solution :)

Thanks a lot for your reply @gabriel-felipe , I will follow that! cheers!