tags:

views:

66

answers:

3

I would like to render websites to an image (JPEG, PNG, PDF, etc.) from a server environment. I have seen a few implementations that use Xvfb but would like to see if there are any decent implementations that would work standalone without X of any sort.

Google Fast Flip seems to do a pretty decent job. I have seen this on a smaller scale where mousing over links pops up a "preview" of the page the link connects to.

+1  A: 

I've successfully used wkhtmltopdf to convert web pages to PDF, which I then convert to images. It's built on top of WebKit.

mbeckish
A: 

Sites like browsershots will do it by loading the webpage into a browser in a VM, then taking a screenshot of the VM environment.

If you have a small number of sites which need snapshots stored, the solutions you linked to should be fine. Otherwise, if you need shots of any/all arbitrary websites, you may want to consider using an existing third-party database of snapshots.

BlueRaja - Danny Pflughoeft
+1  A: 

Back in 2006, I rolled my own version of Webshots using a combination of X, VNCServer, Firefox, PHP, and a few shell scripts. It was somewhat of a hack, but worked extremely well.

I don't see how you're going to do this without using some type of GUI environment. The webpage has to be rendered somehow for a screenshot to be captured. Alternatively, use one of the several commercial solutions that offer an API.

jamieb