2

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.

jh314
  • 27,144
  • 16
  • 62
  • 82
Nirav Alagiya
  • 721
  • 1
  • 5
  • 19
  • How do you capture the actual screenshot? Let's start with this.. html2canvas probably doesn't understand ShadowDOM's or Polyfills and therefore doesn't render it. – flyandi Mar 20 '15 at 20:26
  • Thanks Andy for reply, I found that html2canvas doesn't understand shadowDOM. is there any solution for that. Currently, i am writing my own function to capture screen shot of my custom component. – Nirav Alagiya Mar 23 '15 at 07:25

1 Answers1

0

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

flyandi
  • 1,919
  • 16
  • 25