mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
ignore isFirstPagePortrait
in getPagesOverview
The current behavior for `getPagesOverview` assumes we want to only auto-rotate if: - `enablePrintAutoRotate` is `true` - `isFirstPagePortrait !== isPortraitOrientation(size)` This second check is what is breaking #9297. The two PDFs linked have a landscape orientation first page, as well as subsequent pages. Since `false === false`, we print portrait. Let's drop the comparison with `isFirstPagePortrait`, and print landscape if `!isPortraitOrientation(size)`. Fixes #9297.
This commit is contained in:
parent
e63d1ebff5
commit
04db9d902f
2 changed files with 3 additions and 5 deletions
|
@ -67,8 +67,7 @@ const DEFAULT_CACHE_SIZE = 10;
|
|||
* @property {boolean} [renderInteractiveForms] - Enables rendering of
|
||||
* interactive form elements. The default is `false`.
|
||||
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
||||
* pages whose orientation differ from the first page upon printing. The
|
||||
* default is `false`.
|
||||
* landscape pages upon printing. The default is `false`.
|
||||
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
|
||||
* @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for
|
||||
* some operations. The default value is `false`.
|
||||
|
@ -1203,9 +1202,8 @@ class BaseViewer {
|
|||
if (!this.enablePrintAutoRotate) {
|
||||
return pagesOverview;
|
||||
}
|
||||
const isFirstPagePortrait = isPortraitOrientation(pagesOverview[0]);
|
||||
return pagesOverview.map(function (size) {
|
||||
if (isFirstPagePortrait === isPortraitOrientation(size)) {
|
||||
if (isPortraitOrientation(size)) {
|
||||
return size;
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue