How to capture screen shot of polymer elements in html and javascript?

1.2k Views Asked by At

I have a web page I want that when I click capture button then it should capture the screen of the web page including google polymer elements and save it in root folder. I have tried html2canvas library but it is not working.

1

There are 1 best solutions below

0
flyandi On

I think your best bet is to use a servers side browser-less application like PhantomJS (http://phantomjs.org/) that is built on the latest webkit. You can also use node to call PhantomJS, e.g. https://www.npmjs.com/package/url-to-screenshot

I don't think you will get anything working that is implemented on the frontend that is cross-browser compatible.

Or use a service like https://screenshotmachine.com/ that already implements server side webkit rendering engine, e.g. https://screenshotmachine.com/serve.php?img=polymer-tut-appspot-com-FULL-b521fb.png is a screenshot of the Polymer example https://polymer-tut.appspot.com.

Hope that helps