Skip to content

Examples

Dragon edited this page Jun 4, 2026 · 3 revisions

Examples

Runnable, end-to-end scripts that combine several phppdf subsystems into a realistic document. Each script lives next to its generated PDF in the examples/ directory of the repository.

The examples are kept out of the Composer package (composer require does not download them). To run them, clone the repository.

Running

git clone https://github.com/dragonofmercy/php-pdf.git
cd php-pdf
composer install
php examples/example-invoice.php   # writes examples/example-invoice.pdf next to the script

Catalogue

Example Scenario Subsystems shown
example-invoice.php Commercial invoice Metadata, margins, header/footer with page numbers, table (fixed + fill columns, zebra), totals via cells
example-report.php Multi-page report Flowing Markdown with automatic page breaks, header/footer, bookmarks
example-labels.php Shipping labels Custom page dimensions, Code 128 + QR barcodes, tight text layout
example-catalog.php Product catalogue Card grid of cells, embedded raster image reused across cards, clickable links
example-svg-poster.php Vector poster Full-page inline SVG: gradients, shapes, selectable text

See also

Clone this wiki locally