psliwa/php-pdf
Pure-PHP library for generating PDF documents. Build pages with text, images, shapes, colors, and barcodes; supports fonts, transformations, and simple drawing APIs. Useful for reports, invoices, and dynamic PDFs without external binaries.
Architecture fit
description.md describes a pure-PHP PDF reader/parser/writer (parse, extract text, merge/split), while assessment-pm.md and assessment-tpm.md describe an XML/CSS layout and pagination engine requiring Imagick. Resolve this discrepancy before any estimate is trusted — it changes the dependency list, the runtime footprint, and the target use case (document assembly vs. document generation). This is the first spike task, not an afterthought.Integration feasibility
laminas/* successors.DocumentRenderer interface in the container, loads the builder, resolves fonts and images through configured Laravel disks, and writes output to storage. Roughly 1–2 developer-weeks including the spike, contingent on patch size.Technical risk
Key questions
mpdf, dompdf, or spatie/laravel-pdf (Browsershot) cannot — and is that delta worth an owned fork plus an Imagick dependency?Stack fit
spatie/laravel-pdf (headless Chrome) for fidelity, mpdf/mpdf for pure-PHP portability with real Unicode support, barryvdh/laravel-dompdf for low-complexity documents. Default the roadmap to mPDF or Browsershot; PHPPdf must earn its slot on the graphics/pagination delta.Migration path
DocumentRenderer::render(DocumentSpec): RenderedDocument — not the library integration. The interface is the durable asset; the renderer is swappable.MpdfRenderer or BrowsershotRenderer) from day one. Parity is proven by pushing the same DocumentSpec through both and diffing output. The exit ramp exists before the dependency hardens, which is the single most important risk control in this whole assessment.composer.json repositories rather than depending on Packagist, so patches ship on our release cadence, not upstream's nonexistent one.Compatibility
config/ paths; never rely on the library's default filesystem assumptions.Sequencing
Maintenance
zendframework/* for laminas/*, pin everything, run automated dependency auditing. We will be the only party testing upgrades, so treat every PHP minor bump as a scheduled work item with a ticket, not a surprise.Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?