Webklex / laravel-pdfmerger

A FPDI PDF Wrapper for Laravel which includes the "merge" functionality
MIT License
105 stars 48 forks source link

duplexMerge #24

Open larylinz opened 2 years ago

larylinz commented 2 years ago

Hello! I'm on L9 and try to duplexMerge some PDFs. On my local Installation (Homestead) it works - but on my Server (both PHP8.1) it doesn't. It gives me: Cannot access protected property setasign\Fpdi\Fpdi::$page Simple merge works - duplex throws the error. :/ What could be wrong?

larylinz commented 2 years ago

solved this by changing line 241 in PDFMerger: from '$oFPDI->page': if ($duplexSafe && $oFPDI->page % 2) { $oFPDI->AddPage($file['orientation'], [$size['width'], $size['height']]); } to '$count': if ($duplexSafe && $count % 2) { $oFPDI->AddPage($file['orientation'], [$size['width'], $size['height']]); }

larylinz commented 1 year ago

Added automatic orientation from: https://github.com/GrofGraf/laravel-pdf-merger/pull/11/files (thxs to coupej) I do not know, how do add a pull request - could this to somebody else?

larylinz commented 2 weeks ago

could somebody do a commit to fix autoorientation within duplexMerge? public function duplexMerge($orientation = 'P') => public function duplexMerge($orientation = null)