Download the PHP package pontedilana/weasyprint-bundle without Composer

On this page you can find all versions of the php package pontedilana/weasyprint-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package weasyprint-bundle

WeasyPrintBundle

PhpWeasyPrint is a PHP (7.4+) wrapper for WeasyPrint PDF generator. It allows you to generate PDF files from HTML string or URL.

The WeasyPrintBundle provides a simple integration for your Symfony project.

This bundle is massively inspired by KnpLabs/KnpSnappyBundle, of which it aims to be a one-to-one substitute

Installation

With composer, require:

composer require pontedilana/weasyprint-bundle

Then enable it in your kernel (a flex recipe is coming soon):

Configuration

If you need to change the binaries, change the instance options or even disable one or both services, you can do it through the configuration.

Note: prefer an absolute path for binary (e.g. /usr/local/bin/weasyprint). Since php-weasyprint 2.5.1 the binary is verified with is_executable() before being run, and a bare command name like weasyprint is not resolved against the PATH. If you do leave a bare name, the bundle resolves it through the PATH for you (via Symfony's ExecutableFinder), but an absolute path is faster and unambiguous.

If you want to change temporary folder which is by default, you can use

You can also configure the timeout used by the generators with process_timeout:

Set it to false to disable the timeout entirely (useful when WeasyPrint runs inside a worker or queue that already manages timeouts):

To restrict the URL schemes allowed in options that accept URLs (a defense against SSRF and local file disclosure), use allowed_schemes. When omitted, php-weasyprint applies its own default (['http', 'https']). Requires php-weasyprint 2.6+.

Usage

The bundle registers one service:

Generate a PDF document from a URL

Generate a PDF document from a twig view

Render a PDF document as a response from a controller

Note: Filenames with accented characters (e.g., invoice_àèìòù.pdf) are automatically supported. The bundle generates an ASCII-safe fallback for older browsers while preserving the original UTF-8 filename for modern browsers (following RFC 6266).

Render a PDF document with a relative url inside like CSS files or images

Credits

WeasyPrintBundle and PhpWeasyPrint have been developed by Pontedilana.
SnappyBundle has been developed by KnpLabs.


All versions of weasyprint-bundle with dependencies

PHP Build Version
Package Version
Requires php Version 8.2.* || 8.3.* || 8.4.* || 8.5.*
pontedilana/php-weasyprint Version ^2.0
symfony/config Version ^6.4 || ^7.4 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.4 || ^8.0
symfony/http-foundation Version ^6.4.41 || ^7.4.13 || ^8.0.13
symfony/http-kernel Version ^6.4 || ^7.4.12 || ^8.0.12
symfony/process Version ^6.4.33 || ^7.4.5 || ^8.0.5
symfony/string Version ^6.4 || ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pontedilana/weasyprint-bundle contains the following files

Loading the files please wait ...