PHPackages                             pontedilana/php-weasyprint - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. pontedilana/php-weasyprint

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

pontedilana/php-weasyprint
==========================

PHP library allowing PDF generation from an url or a html page. Wrapper for Kozea/WeasyPrint.

2.4.0(3mo ago)761.1M↓12.8%13[1 issues](https://github.com/pontedilana/php-weasyprint/issues)5MITPHPPHP 7.4.\* || 8.0.\* || 8.1.\* || 8.2.\* || 8.3.\* || 8.4.\* || 8.5.\*CI passing

Since Jul 16Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/pontedilana/php-weasyprint)[ Packagist](https://packagist.org/packages/pontedilana/php-weasyprint)[ GitHub Sponsors](https://github.com/endelwar)[ Fund](https://ko-fi.com/endelwar)[ RSS](/packages/pontedilana-php-weasyprint/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (22)Used By (5)

PhpWeasyPrint
=============

[](#phpweasyprint)

PhpWeasyPrint is a PHP library allowing PDF generation from a URL or an HTML page. It's a wrapper for [WeasyPrint](https://weasyprint.org/), 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 60 or greater is required).

This library is massively inspired by [KnpLabs/snappy](https://github.com/KnpLabs/snappy), of which it aims to be a one-to-one substitute (`GeneratorInterface` is the same). See "[Differences with Snappy](#differences-with-snappy)" section to see how the two differs

Installation using [Composer](https://getcomposer.org/)
-------------------------------------------------------

[](#installation-using-composer)

```
$ composer require pontedilana/php-weasyprint
```

Usage
-----

[](#usage)

### Initialization

[](#initialization)

```
