File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -219,8 +219,9 @@ protected function doMerge($orientation, $duplexSafe) {
219
219
for ($ i = 1 ; $ i <= $ count ; $ i ++) {
220
220
$ template = $ oFPDI ->importPage ($ i );
221
221
$ size = $ oFPDI ->getTemplateSize ($ template );
222
+ $ autoOrientation = ($ size ['h ' ] > $ size ['w ' ]) ? 'P ' : 'L ' ;
222
223
223
- $ oFPDI ->AddPage ($ file [ ' orientation ' ] , [$ size ['w ' ], $ size ['h ' ]]);
224
+ $ oFPDI ->AddPage ($ autoOrientation , [$ size ['w ' ], $ size ['h ' ]]);
224
225
$ oFPDI ->useTemplate ($ template );
225
226
}
226
227
} else {
@@ -229,8 +230,9 @@ protected function doMerge($orientation, $duplexSafe) {
229
230
throw new \Exception ("Could not load page ' $ page' in PDF ' " .$ file ['name ' ]."'. Check that the page exists. " );
230
231
}
231
232
$ size = $ oFPDI ->getTemplateSize ($ template );
233
+ $ autoOrientation = ($ size ['h ' ] > $ size ['w ' ]) ? 'P ' : 'L ' ;
232
234
233
- $ oFPDI ->AddPage ($ file [ ' orientation ' ] , [$ size ['w ' ], $ size ['h ' ]]);
235
+ $ oFPDI ->AddPage ($ autoOrientation , [$ size ['w ' ], $ size ['h ' ]]);
234
236
$ oFPDI ->useTemplate ($ template );
235
237
}
236
238
}
You can’t perform that action at this time.
0 commit comments