Merge pull request #12023 from escapewindow/issue9297
Fix auto-rotate for printing landscape PDFs where the first page is also landscape
This commit is contained in:
commit
d69fb446bf
@ -167,7 +167,7 @@
|
|||||||
},
|
},
|
||||||
"enablePrintAutoRotate": {
|
"enablePrintAutoRotate": {
|
||||||
"title": "Automatically rotate printed pages",
|
"title": "Automatically rotate printed pages",
|
||||||
"description": "When enabled, pages whose orientation differ from the first page are rotated when printed.",
|
"description": "When enabled, landscape pages are rotated when printed.",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
|
@ -67,8 +67,7 @@ const DEFAULT_CACHE_SIZE = 10;
|
|||||||
* @property {boolean} [renderInteractiveForms] - Enables rendering of
|
* @property {boolean} [renderInteractiveForms] - Enables rendering of
|
||||||
* interactive form elements. The default is `false`.
|
* interactive form elements. The default is `false`.
|
||||||
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
||||||
* pages whose orientation differ from the first page upon printing. The
|
* landscape pages upon printing. The default is `false`.
|
||||||
* default is `false`.
|
|
||||||
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
|
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
|
||||||
* @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for
|
* @property {boolean} [enableWebGL] - Enables WebGL accelerated rendering for
|
||||||
* some operations. The default value is `false`.
|
* some operations. The default value is `false`.
|
||||||
@ -1203,9 +1202,8 @@ class BaseViewer {
|
|||||||
if (!this.enablePrintAutoRotate) {
|
if (!this.enablePrintAutoRotate) {
|
||||||
return pagesOverview;
|
return pagesOverview;
|
||||||
}
|
}
|
||||||
const isFirstPagePortrait = isPortraitOrientation(pagesOverview[0]);
|
|
||||||
return pagesOverview.map(function (size) {
|
return pagesOverview.map(function (size) {
|
||||||
if (isFirstPagePortrait === isPortraitOrientation(size)) {
|
if (isPortraitOrientation(size)) {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user