-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Replaced html2canvas with dom-to-image-more #235
base: bugfix/clone-nodes
Are you sure you want to change the base?
Conversation
… issues found by JetBrains WebStorm IDE.
…ngles plus minor refactoring.
Even after waiting for iframe to load, part of the content is still cut-off. No idea why. |
Hi @hakimio, thanks for the PR! And sorry I didn't have a look sooner. dom-to-image uses svg There may be room for allowing multiple renderer options in the future, but I don't think I'll replace html2canvas entirely, especially because of the lack of IE support. |
@eKoopmans yes, I've tried foreign object option in html2canvas but it was resulting in blank image. Never got it to work. IE11 has 5% worldwide desktop browser market share (or 2.29% all browser), is 6 years old and a lot of companies choose to just stop supporting it. It's a terrible browser and it's time for it to go away. Also, the latest versions of html2canvas produce broken results when used with IE11. Anyway, this was just an experiment which didn't work that well. Feel free to close this PR. |
Okay, fair enough. Like I said I am open to supporting multiple renderers, and I have looked into dom-to-image and other A few relevant threads:
I'll keep this PR open in case you get |
@hakimio I really appreciate your work. Actually I was also looking for similar issue. With Html2Canvas facing slowness.IE has been dropped now. Therefore @eKoopmans can you now consider this PR to be merged. It will help a lot of developers. Also, In case you want to have Html2Canvas can we have a flag based implementation for both html2canvas and dom-to-image ? Thank you. |
@sauravgaursmith this is incomplete proof-of-concept. If you would like to use |
While much slower in general, in some cases (for example, box shadows) dom-to-image-more produces much better results. This a simple experiment showing that html2canvas could be replaced by dom-to-image.
Page-breaks seem to be working correctly but part of the content is cut-off. Might be because we are not waiting until our iframe is loaded completely. Haven't verified yet.
PS: Also, fixed few issues found by JetBrains WebStorm IDE static analysis.