Commit 6f995743 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

Keep page orientation and size when splitting pdfs

parent ec88996f
......@@ -268,12 +268,15 @@ class QRSeparator
for ($i = 1; $i <= $pagecount; $i++) {
$new_pdf = new \setasign\Fpdi\Fpdi('P', 'mm');
$new_pdf->AddPage();
$new_pdf->setSourceFile($filename);
$tplidx = $new_pdf->importPage($i);
$new_pdf->useTemplate($tplidx);
$specs = $new_pdf->getTemplateSize($tplidx);
$orientation = $specs['height'] > $specs['width'] ? 'P' : 'L';
$new_pdf->AddPage($orientation);
$new_pdf->useTemplate($tplidx, null, null, null, null, true);
try {
$new_filename = $end_directory.$i.".pdf";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment