centos 安装CutyCapt

CutyCapt是一个截图工具 官方网站 http://cutycapt.sourceforge.net/ 我主要的目的是解决用php保存网页为图片,废话不多少开始安装CutyCapt

yum install epel-release
 
#依赖安装
yum install Xvfb
yum install xorg-x11-fonts*
yum install qtwebkit-devel qt-devel
#中文字体
yum install fonts-chinese

yum install CutyCapt
#测试使用
xvfb-run --server-args="-screen 0, 1920x1080x24" CutyCapt --url=http://www.phpsong.com --out=phpsong.jpg

如果提示错误libEGL warning: DRI2: failed to open swrast (search paths /usr/lib64/dri)
解决方法

yum install mesa-dri-drivers

问题
1)截图时候有乱码
2) 执行速度慢
3)截取百度和小松博客,发现按钮上的文字没有显示,应该也是乱码导致的

PS.中文乱码问题
将windows下的中文字体上传至/usr/share/fonts目录,执行下命令fc-cache即可

测试截图

xvfb-run --server-args="-screen 0, 1920x1080x24" CutyCapt --url=http://www.phpsong.com --out=1.jpg
xvfb-run --server-args="-screen 0, 1920x1080x24" CutyCapt --url=http://www.baidu.com --out=2.jpg
xvfb-run --server-args="-screen 0, 1920x1080x24" CutyCapt --url=http://www.163.com --out=3.jpg
xvfb-run --server-args="-screen 0, 1920x1080x24" CutyCapt --url=http://www.sina.com.cn --out=4.jpg

附上 用CutyCapt 小松博客的截图

1


QQ交流群:136351212
查看原文:https://www.phpsong.com/2542.html
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值