A wrapper for popper-utils for your Laravel project
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
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"
use Murkrow\PdfUtils\Services\ParsePdfTextService;
ParsePdfTextService::create()
->setInputFile("example.pdf")
->flattenText(false)
->execute()
->getOperationResult()
use Murkrow\PdfUtils\Services\MergePdfService;
MergePdfService::create()
->setInputFiles(["1.pdf", "2.pdf"])
->addInputFile("3.pdf")
->setOutputFile("123.pdf")
->execute();
use Murkrow\PdfUtils\Services\SplitPdfService;
SplitPdfService::create()
->setInputFile("123.pdf")
->setOutputFilesDirectory("splitting")
->fromPage(1)
->toPage(3)
->setOutputFileNamePrefix("output")
->execute();
use Murkrow\PdfUtils\Services\ExtractPdfPageRangeService;
ExtractPdfPageRangeService::create()
->fromPage(1)
->toPage(2)
->setInputFile('big.pdf')
->setOutputFile('subset.pdf')
->execute();
use Murkrow\PdfUtils\Services\GetPdfInfoService;
$result = GetPdfInfoService::create()
->setInputFile("123.pdf")
->execute();
dd($result->pages);
vendor/bin/pest
Contributions are welcome, you are free to open a PR or an issue.
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.