Runnable examples for phppdf/phppdf and its sublibraries, covering document creation, text layout, fonts, graphics, pages, navigation, security, tables, imposition, reading existing PDFs, forms, and HTML-to-PDF conversion.
Each example is a standalone PHP script that builds (or reads) a PDF and outputs it directly to the browser, so you can see the result of every API immediately.
- PHP 8.4+
- Composer
docker run -t --rm -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev composer installStart the bundled webserver:
docker compose upThen open http://localhost in your browser and pick an example from the index page.
Alternatively, serve the public/ directory with any PHP-capable webserver, or run a single example directly:
php -S localhost:8000 -t publicpublic/— the example scripts, grouped by category, plus the index page (public/index.html)src/setup-environment.php— shared bootstrap (error reporting, opcache) included by every example