
I Built a Laravel Package for PDF Manipulation (Because Nothing Else Felt Right)
I was working on a client project where we needed to process uploaded PDFs before sending them to an AI model. The documents were multi-page city directory scans, and the AI worked best when fed individual pages rather than entire documents. Simple enough, I just needed to split PDFs. So I started looking for a Laravel package. I found a few options, but nothing that felt right. The Problem with PDF in the Laravel Ecosystem The Laravel ecosystem offers excellent packages for generating PDFs, such as Spatie's laravel-pdf. However, when it comes to manipulating existing PDFs (e.g. splitting, merging, extracting pages or adding watermarks), the story is different. Some of this can be done with existing tools. For example, FPDI can combine pages, and you can wrap CLI tools like qpdf or Ghostscript to split documents. But that leaves you writing all the integration code yourself. There's no filesystem disk support, no service container integration, and no fluent API. I wanted something with
Continue reading on Dev.to Webdev
Opens in a new tab



