g4t/webshot
最新稳定版本:0.1.1
Composer 安装命令:
composer require g4t/webshot
包简介
Package to take screenshoot for web page as image or pdf.
关键字:
README 文档
README
Introduction
Laravel G4T WebShot is a powerful PHP package designed to capture screenshots or generate PDFs from any web page. It provides robust functionality for managing and retrieving screen dimensions based on predefined identifiers.
Installation
To install the Laravel G4T WebShot, follow these steps:
-
Install via Composer:
composer require g4t/webshot
Usage
Getting Started
- Capture and Return Full Path:
To capture a screenshot of a web page and return its URL:
use g4t\WebShot\Screenshot; $save_path = public_path('files/save.png'); return Screenshot::take('https://google.com') ->size('14-inc') ->saveAs($save_path) ->url();
- Capture and Download:
To capture a screenshot of a web page and download it directlyURL:
use g4t\WebShot\Screenshot; $save_path = public_path('files/save.png'); return Screenshot::take('https://google.com') ->size('14-inc') ->saveAs($save_path) ->path();
- Capture and Download:
To capture a screenshot of a web page and download it directly:
use g4t\WebShot\Screenshot; $save_path = public_path('files/save.png'); return Screenshot::take('https://google.com') ->size('14-inc') ->saveAs($save_path) ->download();
- Custom Size:
To specify custom dimensions for the screenshot:
use g4t\WebShot\Screenshot; $save_path = public_path('files/save.png'); return Screenshot::take('https://google.com') ->customSize(width: 1000, height: 1000) ->saveAs($save_path) ->download();
- The following screen sizes are available:
'13-inc', '14-inc', '15-inc', '16-inc', 'iphone-SE1st', 'iphone-SE-2nd', 'iphone-6', 'iphone-6s', 'iphone-7', 'iphone-8', 'iphone-8-plus', 'iphone-11-pro-max', 'ipad-landscape', 'ipad-pro-10.5-landscape', 'ipad-pro-11-inch-landscape', 'ipad-pro-12.9-inch-landscape', 'full-hd', '2k', '4k'
Contributing
Contributions to the Laravel G4T WebShot Package are always welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.
License
The Laravel G4T WebShot is open-source software licensed under the MIT license.
Credits
The Laravel G4T WebShot Package is developed and maintained by HusseinAlaa.
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-29
