Html2canvas: Save screenshot server-side

Created on 22 Oct 2013  Â·  6Comments  Â·  Source: niklasvh/html2canvas

Hi, how can i save the screenshot server-side with java? Or is html2canvas only client-side? I am using html2canvas to capture screen shot of website and i need save screenshot server-side. The user must not see screesnhot of website.

Is it possible with this tool?

P.S. Sorry for my English.

Most helpful comment

@niklasvh
I think @SemanticBeeng is talking about perform capture with ghost user which may frequently(cron) capture page and save it on directory which is accessible to webserver.

I implemented with PhantomJs same functionality but html2canvas is more convenient IMO.

update : Use case
I needed to capture some div as image to post it as Twitter card.

All 6 comments

No, it isn't possible to capture server-side. html2canvas is meant to be running alongside a real DOM.

You can capture client-side and then upload it to the server though.

For server side browsing you can try http://casperjs.org/ or
http://phantomjs.org/

2013/10/22 Niklas von Hertzen [email protected]

No, it isn't possible to capture server-side. html2canvas is meant to be
running alongside a real DOM.

You can capture client-side and then upload it to the server though.

—
Reply to this email directly or view it on GitHubhttps://github.com/niklasvh/html2canvas/issues/283#issuecomment-26809243
.

Thanks for the Tip.

@niklasvh please be kind to explain why one could not get a "real DOM" from PhantomJS on the server side and use html2canvas just like from the client side

Would something like this not work on the server side with html2canvas?

http://stackoverflow.com/questions/12180508/dom-manipulation-with-phantomjs
https://gist.github.com/n1k0/1501173#file-gistfile1-js-L29-L33

Thanks
Nick

@niklasvh
I think @SemanticBeeng is talking about perform capture with ghost user which may frequently(cron) capture page and save it on directory which is accessible to webserver.

I implemented with PhantomJs same functionality but html2canvas is more convenient IMO.

update : Use case
I needed to capture some div as image to post it as Twitter card.

@andresdevsar and @SemanticBeeng can I use phantomjs or casperjs to get screenshots of the current user page which have been edited? you know! I want to let users take the screenshots of the page they have modified but unfortunately, html2canvas doesn't support the CSS properties and I have to use in that page
and I didn't see these abilities in phantomjs or casperjs ...
guide me please!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anthonymejia picture anthonymejia  Â·  4Comments

tibewww picture tibewww  Â·  4Comments

Loki180 picture Loki180  Â·  4Comments

wbarrantes picture wbarrantes  Â·  3Comments

Josh10101010 picture Josh10101010  Â·  3Comments