54853315/phantomagick

PhantomMagick provides a simple API to ease the process of converting HTML to PDF or images

v1.0 2021-03-16 06:26 UTC

This package is auto-updated.

Last update: 2024-04-16 14:19:41 UTC


README

PhantomMagick provides a simple API to ease the process of converting HTML to PDF or images. It's especially handy for things like generating invoices or capturing screenshots of websites. It's framework agnostic but it does provide a facade for simple use in Laravel 4/5.

果酱使用PhantomMagick实现生成海报,PhantomMagick只支持七牛上传,不支持COS,特此创建一个仓库实现COS上传。

Features

  • Convert HTML to a PDF
  • Convert HTML to an image (PNG, JPG or GIF)
  • Support multipage PDFs
  • Capture a web page as a screenshot
  • Save PDF or image to local disk or to the cloud (S3, Dropbox or Rackspace)
  • Framework agnostic, with optional Laravel integration
  • (!!!New)Save PDF or Image to COS

Requirements

Installation

PhantomMagick is available via Composer:

$ composer require 54853315/phantommagick

Dependencies

PhantomJS must be installed to use PhantomMagick.

There are few ways to install PhantomJS:

Install binary manually

You can download the official PhantomJS binary from the following link:

http://phantomjs.org/download.html.

License

The MIT License (MIT). Please see LICENSE for more information.