Skip to content

phppdf/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

examples

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.

Requirements

  • PHP 8.4+
  • Composer

Installation

docker run -t --rm -v ./:/app ghcr.io/phppdf/docker-image-php-cli:dev composer install

Running the examples

Start the bundled webserver:

docker compose up

Then 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 public

Structure

  • public/ — 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

About

A collection of practical examples showcasing PHPPDF features and best practices.

Resources

License

Stars

Watchers

Forks

Contributors

Languages