Open creale opened 4 years ago
No one ??
This worked for me.
in options add:
onclone (document) {
const img = document.querySelector('img[src$="svg"]');
if (img) {
const canvas = document.createElement('canvas'), context = canvas.getContext('2d'), styles = window.getComputedStyle(img);
context.drawImage(img, 0, 0);
for (let key of styles) {
const value = styles[key];
if (value !== '') canvas.style[key] = value;
}
img.replaceWith(canvas);
}
}
this is a bit hackish. What it basicly does is wraps the svg-image inside of an canvas and copies the styles of the image onto the canvas - hopefully then rendering it at least mostly right.
Svg deformed
I'm using the latest version and the non-minified version of html2canvas
I have two issues :
Thank you
Exemple
This is what i want to transform in canva
An this is the result