MIT-licensed PHP library lets developers generate, read, and merge PDFs without GPL or FPDI
A new open-source PHP package called dskripchenko/php-pdf offers a pure-PHP, MIT-licensed solution for generating, reading, and merging PDF files. The library addresses common licensing concerns with popular alternatives like mPDF, which uses the restrictive GPL-2.0 license, and FPDI, whose PDF-parsing add-on is proprietary. Developers can generate PDFs from HTML/CSS, use a fluent builder API, or work at the page level, while a PdfMerger class handles combining files, appending selected pages, and stamping watermarks. The toolkit also supports importing existing PDF pages as backgrounds and overlaying new content, with rotation and crop boxes handled automatically. It integrates with frameworks like Laravel and requires only standard PHP extensions such as ext-mbstring, ext-dom, and ext-zlib.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in