mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 02:47:02 +00:00
Handle merging PDFs with different orientations
This commit is contained in:
@@ -52,7 +52,12 @@ class PdfMerge
|
||||
|
||||
for ($i = 0; $i < $pageCount; $i++) {
|
||||
$tpl = $pdf->importPage($i + 1, '/MediaBox');
|
||||
$pdf->addPage();
|
||||
$size = $pdf->getTemplateSize($tpl);
|
||||
|
||||
// Preserve original page orientation and dimensions
|
||||
$orientation = $size['width'] > $size['height'] ? 'L' : 'P';
|
||||
$pdf->addPage($orientation, [$size['width'], $size['height']]);
|
||||
|
||||
$pdf->useTemplate($tpl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user