I have two choices for my usecase
- The user submits a URL and I capture a screenshot of that webpage, save it in the db and render it as and when required
OR
- Every time the server sends a list of URLs the browser generates screenshots of these URLs
For both cases i have considered using PhantomJS. There are lot of examples of PhantomJS functions invoked from a console, but haven’t found any on how to do it from the server side (java, except for this which i couldn’t get working(line #51, waits for socket connection)) or clientside (using javascript, which i think would be an overhead for the browser). It would be great if someone could help me.
I have thought about third party providers like websnapr but i don’t know how reliable they are.
Oh! I never new it was this simple. It works with two lines of code:
But i would like to have input on which one would be a better approach, server side or client side? And what are the over heads!