Download the PHP package kykint/php-weasyprint without Composer
On this page you can find all versions of the php package kykint/php-weasyprint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kykint/php-weasyprint
More information about kykint/php-weasyprint
Files in kykint/php-weasyprint
Package php-weasyprint
Short Description PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.
License MIT
Informations about the package php-weasyprint
PhpWeasyPrint
This is a fork of WeasyPrint with support PHP 7.2 (Backport).
PhpWeasyPrint
PhpWeasyPrint is a PHP library allowing PDF generation from an URL or an HTML page. It's a wrapper for WeasyPrint, a smart solution helping web developers to create PDF documents, available everywhere Python runs.
You will have to download and install WeasyPrint to use PhpWeasyPrint (version 53 or greater is recommended).
This library is massively inspired by KnpLabs/snappy, of which it aims to be a one-to-one substitute (GeneratorInterface
is the same).
See "Differences with Snappy" section to see how the two differs
Installation using Composer
Usage
Initialization
Display the pdf in the browser
Download the pdf from the browser
Generate local pdf file
Pass options to PhpWeasyPrint
Reset options
Options can be reset to their initial values with resetOptions()
method.
Differences with Snappy
Although PhpWeasyPrint and Snappy are interchangeable, there are a couple of differences between the two, due to WeasyPrint cli API:
- WeasyPrint doesn't support multiple sources to be merged in one single output pdf, so only one input source (string or URL) is accepted in PhpWeasyPrint;
- WeasyPrint version >= 53 doesn't generate images, so image generation from HTML string or URL is possible only with WeasyPrint lower versions (
Pontedilana\PhpWeasyPrint\Image
has been successfully tested with Weasyprint 52.5).
Bugs & Support
If you found a bug please fill a detailed issue with all the following points. If you need some help, please at least provide a complete reproducer so we could help you based on facts rather than assumptions.
- OS and its version
- WeasyPrint, its version and how you installed it
- A complete reproducer with relevant PHP and html/css/js code
If your reproducer is big, please try to shrink it. It will help everyone to narrow the bug.
Credits
PhpWeasyPrint has been originally developed by the Pontedilana dev team.
Snappy has been originally developed by the KnpLabs team.