Website thumbnail / screenshots generators for windows: http://www.zubrag.com/scripts/website-thumbnail-generator.php IECapt
For Linux: http://www.boutell.com/webthumb/ http://www.zubrag.com/forum/index.php?topic=55.0
Reference: http://corpocrat.com/2008/08/26/capturing-a-screenshot-of-a-website/ How to Capture a Website Screenshot in Linux
You might be wondering how to capture a website screenshot (as thumbnail) but What is Needed? Linux Server with Centos/RHEL Khtml2Png (http://khtml2png.sourceforge.net) ImageMagick (http://imagemagick.org) KDE Desktop Environment Cmake – http://www.cmake.org Screenshot Capturing Basics
Most linux servers will usually not have a graphics card or output device like First install Xvfb server and ImageMagick yum install Xvfb ImageMagick then, yum install firefox start the virtual display > Xvfb :2 -screen 0 1024x768x24&
// This starts the virtual server with display no 2, screen no 1 on resolution Run the firefox on the virtual display in the command line > DISPLAY=:2 firefox http://www.example.com
Wait for 5 seconds until, it loads and then capture a screenshot with ImageMagick’s > import -window root example.png
once this is done, you can resize the images later with convert Using Khtml2PNG
khtml2png is another way of capturing a website screenshot of specified width khtml2png requires KDE, gcc compiler, cmake and kde-devel libraries,
If you have a new linux server, prepare your server with c compiler and other Install Basic Tools yum install gcc gcc-c++ automake autoconf nano zlib zlib-devel Install KDE desktop environment yum groupinstall "X Window System" "KDE (K Desktop Environment)" Install KDE developer libraries yum install kdelibs kdelibs-devel Install Xvfb Virtual Frame Buffer yum install Xvfb xorg xorg-x11-font* Install Cmake
Cmake is cross plaform make utility. You cannot install using yum so you have wget <path/of/cmake.tar.gz> tar zxf cmake-2.7.1.tar.gz
cd cmake-2.7.1 make make install Install Khtml2PNG Download the source files from sourceforge. wget <path/to/khtml2png-2.7.5.tar.gz>
tar xzf khtml2png-2.7.5 make install Final Steps Start Xvfb virtual server, then launch the khtml2png to grab a website screenshot > Xvfb :2 -screen 0 1024x768x24& > export DISPLAY=localhost:2.0 then run khtml2png2 > khtml2png2 --sw 200 --sh 150 http://www.example.com example.png –sh and –sw indicates both scaled width and height
To view the image in the browser copy those created screenshot to apache /var/www/html
If you want khtml2png run as daemon you might want to install Common Errors
I am documenting the common errors i got and how i fixed those. Few i was able khtml2png2: cannot connect to X server
[This means you have not assigned the display where Xvfb is running. Try export Couldn't open RGB_DB '/usr/share/X11/rgb'
[Xvfb might throw this error if you set the resolution to 32 bit color depth. Example: Xvfb :2 -screen 0 800x600x24&] error opening security policy file /usr/lib/xserver/SecurityPolicy [Login as a user other than root]
Could not init font path element /usr/share/X11/fonts/TTF/, removing Could not init font path element /usr/share/X11/fonts/OTF, removing from list!
Could not init font path element /usr/share/X11/fonts/Type1/, removing from Could not init font path element /usr/share/X11/fonts/CID/, removing from list!
Could not init font path element /usr/share/X11/fonts/100dpi/, removing from
Could not init font path element /usr/share/X11/fonts/75dpi/, removing from [Try yum install xorg-x11-font*]
CMake Error: The following variables are used in this project, but
Please set them or make sure they are set and tested correctly in the CMake QT_INCLUDE_DIR (ADVANCED)
[Install qt and qt-devel packages. If that Enjoy!
Pass your 70-648 certification exam with testking and also practice for next level 70-662 and 70-663 exam. Similar Posts:
Comments From tracy jq at Thu Apr 19 2012 13:27:29 GMT 0800
----------- Leave your comment(s) below: | To start Your own Blog Other Blogs » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » » | ||



