niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.69k stars 4.82k forks source link

Some issues with html2canvas #1256

Open abriginets opened 7 years ago

abriginets commented 7 years ago

Hello. It's really a pleasure for me to have a plugin like this. But there's some issues I'd like to report

1) html2canvas not working in latest Firefox 2) Generated images are blurry and sometimes cropped 3) <svg> is not processing by html2canvas

I'm using 0.5.0-beta-4, btw.

Regards, Andrew.

niklasvh commented 6 years ago

Is this still an issue with v1.0.0? If so, could you please share an example on jsfiddle.

abriginets commented 6 years ago

@niklasvh oh, now screenshots are not blurry anymore. But <svg> tags are still processing incorreclty. Here, take a look:

Screenshot made with Gyazo. That's how block should look like:

image-default

But for the first time I'm keep getting this:

91a57ae85afe89e84c1bfa4dad7142e2

That's because it have a transparency(idk why, default option for background is #fff. Even if I specify background: #fff it'll still have half-transparent). But, if I try to re-render it a few times it becomes OK except <svg> in the top right corner:

image-html2canvas

Btw, the card I'm trying to make a screenshot of was dynamically added on the page if it helps you to solve the issue.

niklasvh commented 6 years ago

Does the background issue fix itself if you set backgroundColor: #ffffff in the options with 1.0.0-alpha.4?

abriginets commented 6 years ago

@niklasvh yes, updating to 1.0.0-alpha.4 has fixed the issue with background color. <svg> is still rendering incorrectly.

default

niklasvh commented 6 years ago

Would you be able to replicate the SVG issue on jsfiddle so I could take a look?

abriginets commented 6 years ago

@niklasvh sure, take a look: https://jsfiddle.net/khqgasLz/