-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Error in .html() method when element has background-image property #2470
Comments
hi, well this is a bug. jspdf canvas has to get a attribute "ownerDocument" which should be a by reference link to document. Then probably it will break somewhere else :D |
Hey, I reproduce this on my local. |
Hey guys! Here is what I made to solve the undefined 'ownerDocument' on the canvas. When the background-image attribute from the HTML element to print is removed, the function "resizeImage" is not called because there is no image in the given element. |
Same issue here... can we expect a fix? |
We should probably add this fix to the next release. |
This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant. |
I confirm the issue |
@andrescst could you prepare a pull request? We might also try updating to html2canvas@1.0.0-rc.7. |
Hey, I have no longer access to @andrescst account but ill be happy to do it from this one. |
@andruts @HackbrettXXX Is there a workaround or timeline for when this will be merged / fixed? |
@subourbonite a workaround would be to draw the background yourself. There is no timeline for a fix ATM. I personally don't have time for it currently. But any help is welcome. |
I'm trying to add content from HTML element (with using
.html()
method) but gettinghtml2canvas
error.Source HTML:
<div id="element-to-print" style="background: url('/Content/Images/page-template.png'); background-size: contain;"></div>
JS:
Error:
If remove css property
background-image
andbackground-size
- everything works fine. What can be the reason?Thank you in advance!
The text was updated successfully, but these errors were encountered: