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

Merge pull request #9586 from Snuffleupagus/pageSize-api-rotate

Ensure that `PDFPageProxy.pageSizeInches` handles non-default /Rotate entries correctly
This commit is contained in:
Tim van der Meij 2018-03-25 18:03:32 +02:00 committed by GitHub
commit 5c1a16ba6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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