grofgraf / laravel-pdf-merger Goto Github PK
View Code? Open in Web Editor NEWPackage for Laravel that merges multiple PDFs into one.
License: MIT License
Package for Laravel that merges multiple PDFs into one.
License: MIT License
How do I combine files from a URL, such as AWS s3? Is it possible to override local path?
Thank you for the package.
Could you please fix the psr-4 warning? Soon we will start using compose 2, and it want autoload.
Thanks
There is in issue with Laravel 6 and over. The str_random() is not available anymore into laravel. We must add the following into PDFMerger.php
use Str;
and change str_random(16)
to Str::random(16)
We also need to add Laravel\Helpers to composer.
https://laravel.com/docs/6.x/upgrade#helpers
Hi,
I got the following error in my error log, when merging pdf's.
The code that gives the error, and interacts with the package:
$merger = \PDFMerger::init();
$this->tickets->each(function(Ticket $ticket) use ($merger) {
$merger->addPDFString($ticket->getRawPdf(), 'all', 'P');
});
$merger->merge();
return $merger->string();
Am i doing something wrong here? Or is there an issue in the package/underlaying library?
Your package is great, but there is one issue after download the merged pdf file, and I am trying to edit pdf file using online pdf editors and software like "Adobe Pro" and "Xchange". After finishing my editing on pdf then I will upload to the site and download again, the editing text and lines are not showing on pdf file. How I will resolve this issue.
Thanks
How to fixed issue as
fopen(C:\xampp\htdocs\rcbdst\storage\tmp/llvMWgHHKXLgIjik.pdf): failed to open stream: No such file or directory
Hello,
Can you please add the Duplex merge functionality like in the Webklex/LaravelPDFMerger package please.
Thank you
your package suddenly not working and when i run "composer dump-autoload" i get message
Class GrofGraf\LaravelPDFMerger\Providers\PDFMergerServiceProvider located in ./vendor/grofgraf/laravel-pdf-merger/src/providers/PDFMergerServiceProvider.php does not comply with psr-4 autoloading standard. Skipping.
and then i rename folder manualy from
vendor/grofgraf/laravel-pdf-merger/src/facades
vendor/grofgraf/laravel-pdf-merger/src/providers
to
vendor/grofgraf/laravel-pdf-merger/src/Facades
vendor/grofgraf/laravel-pdf-merger/src/Providers
and your package run normal again, may be this occur because case sensitive between folder name and namespaces.
Thank you.
Hello friends. Based on my research, it seems I have the error listed below due to a PHP version incompatibility.
Current PHP version : 5.4.452.0
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) in /path_to_file/PDFMerger.php on line 12
I can't change the PHP version so is there a way to change the the code to make this work?
Please advise and thanks in advance.
Steven
Hi,
I have the issue when I try to merge multiple PDF's that it gives me the error:
[2019-04-08 12:21:50] dev.ERROR: FPDF error: The document is closed {"exception":"[object] (Exception(code: 0): FPDF error: The document is closed at /project/vendor/setasign/fpdf/fpdf.php:271)
[stacktrace]
#0 /project/vendor/setasign/fpdf/fpdf.php(295): FPDF->Error('The document is...')
#1 /project/vendor/setasign/fpdi/src/FpdfTplTrait.php(329): FPDF->AddPage('P', Array, 0)
#2/project/vendor/grofgraf/laravel-pdf-merger/src/PDFMerger.php(177): setasign\\Fpdi\\FpdfTpl->AddPage('P', Array)
#3 /project/app/Jobs/ProcessCoupons.php(49): GrofGraf\\LaravelPDFMerger\\PDFMerger->merge()
#4 [internal function]: App\\Jobs\\ProcessCoupons->handle(
$merger = \PDFMerger::init();
$registration->coupons->each(function($coupon) use ($merger) {
$pdf = Storage::disk('coupons')->path($coupon->file_path);
$merger->addPDFString($pdf);
});
$merger->merge();
$merger->save(sprintf('%s_%s_%s.%s', 'coupon_merged', time(), mt_rand(1000, 9999), 'pdf'));
My Setup:
"grofgraf/laravel-pdf-merger": "^1.0",
"laravel/framework": "5.5.*",
"php": ">=7.1.0",
What causes the issue that it's returning that error? It creates the tmp folder with temporary PDFs but it's not merging.
Is it possible to combine 2 PDFs but it keeps its original orientation?
So the end merged PDF has a combo of Portrait and Landscape?
When I run the command as null it still overrides to portrait.
Hi mate, great package, but if you try to use the latest version of laravel as 7, the random string should be updated.
$filePath = storage_path('tmp/'.str_random(16).'.pdf');
The general error is : Call to undefined function GrofGraf\LaravelPDFMerger\str_random()
Anchor tags with long URL with word-wrap is considered invalid click links
Clicking on this is navigating me to this http://www.thisisthelongesteur
instead of http://www.thisisthelongesteuropeandomainnameallovers.com
Code:
<a href="http://www.thisisthelongesteuropeandomainnameallovers.com"> http://www.thisisthelongesteuropeandomainnameallovers.com </a>
I got error as follow;
fopen(C:\wamp64\www\testacb\storage\tmp/0EqoGVGAIMqcft1Q.pdf): failed to open stream: No such file or directory
I created 'tmp' folder under 'storage' directory.
I use WAMP server on Windows 10. - PHP 7.3
How can I fix this problem.
Thanks
PDFMergerServiceProvider and PDFMergerFacade are failing to autoload when using Composer 2. Output from composer install:
Deprecation Notice: Class GrofGraf\LaravelPDFMerger\Providers\PDFMergerServiceProvider located in ./vendor/grofgraf/laravel-pdf-merger/src/providers/PDFMergerServiceProvider.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class GrofGraf\LaravelPDFMerger\Facades\PDFMergerFacade located in ./vendor/grofgraf/laravel-pdf-merger/src/facades/PDFMergerFacade.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.