Web Link 2 Image

WebThumb using PHP

We have to install opera/firefox first on server.

Then install Xvfb for Xvfb virtual framebuffer

html2image.sh
……………………….

#! /bin/sh

/etc/init.d/xvfb start

export DISPLAY=:7

DISPLAY=:7 opera –remote ‘openURL(‘$1′)’ &

sleep 20

DISPLAY=:7 import -window root $2

/etc/init.d/xvfb stop

Uses:
# ./html2image.sh http://www.svnlabs.com webthumb/svnlabs.png

Open FireFox in Xvfb: firefox.sh
#!/bin/sh
mozilla-firefox -a firefox -remote ‘openURL(‘$1′, new-tab)’ || mozilla-firefox $1 &

Uses:
# ./firefox.sh http://www.svnlabs.com

Full Article http://blog.svnlabs.com/create-webthumb-using-lamp/

Subscribe Scroll to Top