Download the PHP package mvlabs/mvlabs-snappy without Composer
On this page you can find all versions of the php package mvlabs/mvlabs-snappy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mvlabs/mvlabs-snappy
More information about mvlabs/mvlabs-snappy
Files in mvlabs/mvlabs-snappy
Package mvlabs-snappy
Short Description MvlabsSnappy is a Zend Framework and Laminas module that allow easy to thumbnail, snapshot or PDF generation from a url or a html page using Snappy PHP wrapper for the wkhtmltopdf/wkhtmltoimage conversion utility.
License MIT
Homepage https://github.com/mvlabs/MvlabsSnappy.git
Informations about the package mvlabs-snappy
MvlabsSnappy
MvlabsSnappy is a Laminas 3 module that allow easy to thumbnail, snapshot or PDF generation from a url or a html page using Snappy PHP (5.6+) wrapper for the wkhtmltopdf conversion utility.
Installation
With composer
php composer.phar require mvlabs/mvlabs-snappy
Post installation
- Enabling it in your
application.config.php
file.
Configuration
After installing MvlabsSnappy, copy
./vendor/mvlabs/MvlabsSnappy/config/mvlabs-snappy.local.php.dist
to
./config/autoload/mvlabs-snappy.local.php
and change the binaries path and add options as desired.
# /config/autoload/mvlabs-snappy.local.php
wkhtmltopdf binary as composer dependencies
If you want to download wkhtmltopdf with composer you add to composer.json
:
Or require the package for i386 with:
php composer.phar require h4cc/wkhtmltopdf-i386 "0.12.4"
If you are in 64 bit based system:
Or require the package for amd64 with:
php composer.phar require h4cc/wkhtmltopdf-amd64 "0.12.4"
The binary will then be located at:
vendor/h4cc/wkhtmltopdf-i386/bin/wkhtmltopdf-i386
Also a symlink will be created in your configured bin/ folder, for example:
vendor/bin/wkhtmltopdf-i386
Usage
The module registers two services:
- the
mvlabssnappy.image.service
service allows you to generate images; - the
mvlabssnappy.pdf.service
service allows you to generate pdf files.
Generate an image from an URL
$mvlabsSnappyImage = $container->get('mvlabssnappy.image.service'),
$mvlabsSnappyImage->generate('http://www.mvlabs.it', '/path/to/myapp/data/image.jpg');
Generate a pdf document from an URL
$mvlabsSnappyPdf = $container->get('mvlabssnappy.pdf.service'),
$mvlabsSnappyPdf->generate('http://www.mvlabs.it', '/path/to/myapp/data/document.pdf');
Render a pdf document as response from a controller
Credits
MvlabsSnappy and Snappy are based on the awesome wkhtmltopdf. MvlabsSnappy has been developed by mvlabs.
All versions of mvlabs-snappy with dependencies
laminas/laminas-servicemanager Version ^3.1
knplabs/knp-snappy Version ^1.0