예전에 제 블로그에 올렸던 글인데요 재탕할께요.

How to Capture a Website Screenshot in Linux

http://blog.naver.com/belladonnaf/50094171932

1. 필요한 것.
Linux Server with Centos/RHEL
Khtml2Png (http://khtml2png.sourceforge.net)
ImageMagick (http://imagemagick.org)
KDE Desktop Environment
Cmake - http://www.cmake.org

2. 설치방법

yum install Xvfb ImageMagick
yum install firefox

Xvfb :2 -screen 0 1024x768x24&
export DISPLAY=:2
import -window root example.png

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 to download the source files and compile it.

wget <path/of/cmake.tar.gz>
tar zxf cmake-2.7.1.tar.gz
cd cmake-2.7.1

then

./bootstrap
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

./configure
make install

마지막으로 ..

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

khtml 이 정말 단순한 브라우저에요                                       
2011/10/23 12:00 2011/10/23 12:00

Trackback Address :: 이 글에는 트랙백을 보낼 수 없습니다