1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Ensure that PDFPageProxy.pageSizeInches handles non-default /Rotate entries correctly

Without this patch, the pageSize will be incorrectly reported for some PDF files.

---

Move pageSizeInches to ui_utils
This commit is contained in:
Jonas Jenwald 2018-03-19 17:27:04 +01:00
parent 0d391daccc
commit d547936827
5 changed files with 56 additions and 25 deletions

View file

@ -874,19 +874,6 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
return this.pageInfo.view;
},
/**
* The size of the current page, converted from PDF units to inches.
* @return {Object} An Object containing the properties: {number} `width`
* and {number} `height`, given in inches.
*/
get pageSizeInches() {
const [x1, y1, x2, y2] = this.view, userUnit = this.userUnit;
return {
width: (x2 - x1) / 72 * userUnit,
height: (y2 - y1) / 72 * userUnit,
};
},
/**
* @param {number} scale The desired scale of the viewport.
* @param {number} rotate Degrees to rotate the viewport. If omitted this