简体   繁体   中英

How do I take a screenshot of a web page?

I'm using html2canvas to get screenshots of my web app. But I'm not able to use images from URLs due to CORS restrictions even after using proxy. Any alternatives available for html2canvas?

(I need to take the screenshot from within the html page - on the click of a button)

您可以使用cutycapt截取网页的屏幕截图,请参阅此链接以获取完整文档http://cutycapt.sourceforge.net/

html2canvas should work, atleast it works fine for me

try

html2canvas($('#map'), {
                    useCORS: true,
                    allowTaint:true,
                    onrendered: function(canvas) {
                       document.body.appendChild( canvas );
                    }
});

Focus on that useCORS and allowTaint:true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM