murkrow/pdf-utils

A poppler-utils wrapper for Laravel applications
18,645 1
Install
composer require murkrow/pdf-utils
Latest Version:1.0.1
PHP:^8.2
Laravel:12 · 13
Older releases:10 · 11
License:MIT
Last Updated:Oct 2, 2026
Links: GitHub  ·  Packagist
Maintainer: murkrow

pdf-utils

Latest Stable Version Total Downloads

A wrapper for poppler-utils for your Laravel project

Compatibility

Package version Laravel version PHP version
1.x 12.x – 13.x ^8.2

Prerequisites

Ensure to have poppler-utils installed on your system. You can install it with the following command:

sudo apt-get install poppler-utils

or if you are using a Mac:

brew install poppler

Installation

You can install the package via composer:

composer require murkrow/pdf-utils

You can publish the config file with:

php artisan vendor:publish --provider="Murkrow\PdfUtils\PdfUtilsServiceProvider"

Usage

Convert PDF to text

use Murkrow\PdfUtils\Services\ParsePdfTextService;
ParsePdfTextService::create()
        ->setInputFile("example.pdf")
        ->flattenText(false)
        ->execute()
        ->getOperationResult()

Merge multiple PDFs into one

use Murkrow\PdfUtils\Services\MergePdfService;
MergePdfService::create()
        ->setInputFiles(["1.pdf", "2.pdf"])
        ->addInputFile("3.pdf")
        ->setOutputFile("123.pdf")
        ->execute();

Split PDF into multiple PDFs

use Murkrow\PdfUtils\Services\SplitPdfService;
SplitPdfService::create()
        ->setInputFile("123.pdf")
        ->setOutputFilesDirectory("splitting")
        ->fromPage(1)
        ->toPage(3)
        ->setOutputFileNamePrefix("output")
        ->execute();

Extract page range from PDF

use Murkrow\PdfUtils\Services\ExtractPdfPageRangeService;
ExtractPdfPageRangeService::create()
    ->fromPage(1)
    ->toPage(2)
    ->setInputFile('big.pdf')
    ->setOutputFile('subset.pdf')
    ->execute();
        

Get PDF info (incomplete)

use Murkrow\PdfUtils\Services\GetPdfInfoService;
$result = GetPdfInfoService::create()
        ->setInputFile("123.pdf")
        ->execute();

dd($result->pages);

Testing

vendor/bin/pest

Contributing

Contributions are welcome, you are free to open a PR or an issue.

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

Related Packages

barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

119,195,391 7,286
barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

28,627,638 2,754
elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3,183,375 357
codedge/laravel-fpdf

Laravel package to include Fpdf. It ships with Fpdf 1.86.

2,016,145 293
lucasromanojf/laravel5-pdf

Provides the HTML2PDF functionality using the wkhtmltopdf library (Laravel 5)

72,636 7

Version History

Version Released PHP Laravel License
1.0.1 ^8.2 ^12.0 || ^13.0 MIT
1.0 ^8.2 ^12.0 MIT
0.5 ^8.2 ^11.0 MIT
0.4 ^8.1 ^10.28 MIT
0.3 ^8.1 ^10.28 MIT