html2canvas - no screenshot for iframe

馋奶兔 提交于 2019-12-05 07:30:27
Mario Madrigal

The problem here is that you are not pointing correctly to the part of the iframe that you want to take the screenshot, instead your are pointing directly to the document body.

you can try this:

var body = $(iframe).contents().find('body')[0];
        html2canvas(body, {
            onrendered: function( canvas ) {
                $("#content").empty().append(canvas);
            }, 

Hope this helps!

Seems like it's not possible:

The script doesn't render plugin content such as Flash or Java applets. It doesn't render iframe content either.

http://html2canvas.hertzen.com/documentation.html#limitations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!