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:
commit
5c1a16ba6e
5 changed files with 56 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue