之前在安裝過程中碰到很多問題,也找了不少資料。現總結了下,給有需要的朋友。
centos下安裝cutycapt比較麻煩,需要先安裝qt47,再下載cutycapt源碼編譯;而在ubuntu下安裝cutycapt就很簡單,一條命令就搞定。
ps:以下方法在centos 6.3和ubuntu 12.04安裝成功。
centos下安裝cutycapt:
1、安裝qt47
增加qt47的源
vim /etc/yum.repos.d/atrpms.repo [atrpms] name=CentOS $releasever – $basearch – ATrpms baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms gpgcheck=1 enabled=1 [atrpms-testing] name=CentOS $releasever – $basearch - ATrpms testing baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms gpgcheck=1 enabled=1
yum update yum install qt47 yum install qt47-devel yum install qt47-webkit yum install qt47-webkit-devel
2、安裝cutycapt
yum install svn svn co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt mv cutycapt/CutyCapt /usr/local/cutycapt cd /usr/local/cutycapt qmake qmake-qt47
3、安裝xvfb
yum install Xvfb
4、測試cutycapt截圖
xvfb-run --server-args="-screen 0, 1024x768x24" CutyCapt --url=http://www.baidu.com --out=baidu.png
5、將xvfb置入后台運行
Xvfb -fp /usr/share/fonts :0 -screen 0 1024x768x24 & DISPLAY=:0 ./CutyCapt --url=http://www.baidu.com --out=baidu.png
ubuntu下安裝cutycapt
1、兩條命令搞定
apt-get install cutycapt apt-get install xvfb
2、測試截圖
xvfb-run --server-args="-screen 0, 1024x768x24" CutyCapt --url=http://www.baidu.com --out=baidu.png
中文亂碼問題:
將windows下的中文字體上傳至/usr/share/fonts目錄,執行下命令fc-cache即可。
截圖效果: