How to install and use CutyCapt in centos

Source: Internet
Author: User
Tags centos

CutyCapt is a screenshot tool.

Official website http://cutycapt.sourceforge.net/
My main goal is to save the web page as an image in php, and start installing CutyCapt without much nonsense.

Yum install epel-release
 
# Dependency installation
Yum install Xvfb
Yum install xorg-x11-fonts *
Yum install qtwebkit-devel qt-devel
# Chinese font
Yum install fonts-chinese

Yum install CutyCapt

# Test use

Xvfb-run -- server-args = "-screen 0, 1920x1080x24" CutyCapt -- url = http://www.phpsong.com --out1_phpsong.jpg


If the error libEGL warning: DRI2: failed to open swrast (search paths/usr/lib64/dri) is returned)

Solution

Yum install mesa-dri-drivers

Problem

1) garbled characters appear during screenshots
2) slow execution speed
3) truncate Baidu and Komatsu's blog and find that the text on the button is not displayed. It should also be garbled.


PS. Chinese garbled characters

Upload the Chinese font in windows to the/usr/share/fonts directory and run the fc-cache command.


Test screenshot

Xvfb-run -- server-args = "-screen 0, 1920x1080x24" CutyCapt -- url = http://www.phpsong.com --out00001.jpg
Xvfb-run -- server-args = "-screen 0, 1920x1080x24" CutyCapt -- url = http://www.baidu.com --out00002.jpg
Xvfb-run -- server-args = "-screen 0, 1920x1080x24" CutyCapt -- url = http://www.163.com --out00003.jpg
Xvfb-run -- server-args = "-screen 0, 1920x1080x24" CutyCapt -- url = http://www.sina.com.cn --out00004.jpg

Example

<? Php
/*
Web screenshot function, IE + CutyCapt must be installed
Url: The webpage to take a screenshot
Out: image storage path
Path: CutyCapt path
Cmd: CutyCapt
For example, http: // Your php path. php? Url = http://www.111cn.net
*/
$ Url = $ _ GET ["url"];
$ Imgname = str_replace ('http: // ', '', $ url );
$ Imgname = str_replace ('https: // ', '', $ imgname );
$ Imgname = str_replace ('.', '-', $ imgname );
$ Out = 'd:/webroot/test/'.w.imgname.'.png ';
$ Path = 'd:/webserver/CutyCapt.exe ';
$ Cmd = "$ path -- url = $ url -- out = $ out ";
Echo $ cmd;
System ($ cmd );
?>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.