PHP to implement the CUTYCAPT command to achieve a screenshot of the method _php skills

Source: Internet
Author: User

This article is an example of how PHP implements a screenshot of a Web page by executing the CUTYCAPT command. Share to everyone for your reference, specific as follows:

Using EXEC to execute commands with PHP

PS. The EXEC function is disabled by default, open php.ini check disable_function Whether it contains this or, remove

Copy Code code as follows:
EXEC (' xvfb-run--server-args= "-screen 0, 1024x768x24" cutycapt--url=http://www.jb51.net--out=2.jpg ');

A problem in this one my picture is only the first screen, so crop the picture
Copy Code code as follows:
Yum Install ImageMagick

to crop using Convert-crop
Copy Code code as follows:
Convert-crop 1024x768+0+0 2.jpg 22.jpg

Use convert-resize for picture scaling
Copy Code code as follows:
Convert-resize 15%x15% 22.jpg 22.jpg

For more information on PHP related content readers can view the site topics: "PHP graphics and pictures Operating skills summary", "Basic PHP Grammar Introductory Course", "PHP Operations and Operator Usage Summary", "PHP object-oriented Program Design Introductory Course", "PHP Network Programming Skills Summary", "PHP array (Array) Operations tips Encyclopedia, "PHP string (String) Usage Summary", "Php+mysql Database operation Introduction Tutorial" and "PHP Common database Operation tips Summary"

I hope this article will help you with the PHP program design.

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.