tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.28k stars 1.68k forks source link

bug?iframe nothing? #270

Closed hktalent closed 5 years ago

hktalent commented 5 years ago

bug?iframe nothing?

145

var iframeContent = $(o.contentDocument || o.contentWindow.document).find("div.box")[0];
    domtoimage.toJpeg(iframeContent,{ quality: 0.65 }).then(function (dataUrl)
    {
            var link = document.createElement('a');
            link.download = id + '.jpeg';
            link.href = dataUrl;
            link.click();
    });

image

save: image

Adondriel commented 5 years ago

have you tried attaching to a dom item, inside of the iframe?

hktalent commented 5 years ago

ok @Adondriel