Download the PHP package daif/chrome-pdf-bundle without Composer

On this page you can find all versions of the php package daif/chrome-pdf-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 chrome-pdf-bundle

ChromePdfBundle

WYSIWYPDF -- What You See Is What You PDF

The dockerless PDF generator for Symfony. Just Chrome. No containers, no wrapping, no kidding.

composer require daif/chrome-pdf-bundle

Why this bundle?

I wanted to use sensiolabs/gotenberg-bundle -- it's a great and complete Symfony bundle for PDF generation. But it relies on Gotenberg, which requires a running Docker container.

In my case, working in on-premise environments (banking, insurance, regulated industries), Docker is simply not available on production servers. Security policies and infrastructure constraints prevent running containers.

Yet these same machines almost always have a browser installed, or can easily add one. Google Chrome and Chromium are well-maintained, widely trusted, and available on virtually every Linux distribution through standard package managers.

So I built ChromePdfBundle: the same clean builder-based API, but driving Chrome/Chromium directly via the Chrome DevTools Protocol -- no Docker, no external service, no extra infrastructure.

Docker-based solutions ChromePdfBundle
Require Docker + a running container Requires only a Chrome/Chromium binary
HTTP calls to an external service Direct communication via CDP
Extra infrastructure to maintain Uses a browser already on the system
Not usable in Docker-free environments Works everywhere Chrome runs

How to install

Requirements

This installs the bundle along with chrome-php/chrome, the PHP library used to communicate with Chrome via the DevTools Protocol.

Enable the bundle

If not using Symfony Flex, manually register the bundle:

Configuration

Create a minimal configuration:

The bundle will automatically detect Chrome/Chromium on your system. You can also specify the binary path explicitly:

Basic Usage

PDF from Twig template

PDF from URL

PDF from Markdown

Screenshot

Twig assets

If a template needs to link to a static asset (image, CSS, font), use the {{ chrome_pdf_asset() }} Twig function:

Advanced Usage

  1. Chrome installation guide
  2. Configuration
  3. Processing (saving, streaming, S3...)
  4. Working with assets
  5. Working with fonts

PDF

  1. HTML Builder
  2. URL Builder
  3. Markdown Builder
  4. Header / Footer

Screenshot

  1. HTML Builder
  2. URL Builder
  3. Markdown Builder

Licence

MIT License (MIT): see the License File for more details.


All versions of chrome-pdf-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-filter Version *
ext-json Version *
chrome-php/chrome Version ^1.15
league/commonmark Version ^2.8
psr/container Version ^2.0
psr/log Version ^3.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/filesystem Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/service-contracts Version ^3.6
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 daif/chrome-pdf-bundle contains the following files

Loading the files please wait ...