eKoopmans / html2pdf.js

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

SVG file in child block didn't get printed #673

Open sDuyToans opened 5 months ago

sDuyToans commented 5 months ago

Hi, i'm facing an issues. I came here from a forge of low-code platform name os. The require is capture the screen and print at pdf file. The html2pdf worked really fine. But the svg inside child block didn't get print, also the footer is in wrong position, because it is fixed so when i print it will appear in the part that the screen capture. Here is my code:

var element = document.getElementById($parameters.ContainerId); if ($parameters.ContainerId == 'Body'){ element = document.body } var opt = { margin: $parameters.Margin, filename: $parameters.FileName, image: {type: 'jpg', quality: 0.99}, html2canvas: {dpi: 192, letterRendering: true, useCORS: true}, jsPDF: { unit: "mm", format: 'b3', orientation: "l" }, }; html2pdf() .set(opt) .from(element) .toContainer() .then(function(){ var doc = $('.html2pdf__container'); doc.find('.show-on-export').show(); // show content hide by CSS. }) .save(); any have solution for this