mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +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:
parent
0d391daccc
commit
d547936827
5 changed files with 56 additions and 25 deletions
|
@ -13,7 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { cloneObj, getPDFFileNameFromURL, NullL10n } from './ui_utils';
|
||||
import {
|
||||
cloneObj, getPageSizeInches, getPDFFileNameFromURL, NullL10n
|
||||
} from './ui_utils';
|
||||
import { createPromiseCapability } from 'pdfjs-lib';
|
||||
|
||||
const DEFAULT_FIELD_CONTENT = '-';
|
||||
|
@ -92,7 +94,7 @@ class PDFDocumentProperties {
|
|||
this._parseDate(info.CreationDate),
|
||||
this._parseDate(info.ModDate),
|
||||
this.pdfDocument.getPage(currentPageNumber).then((pdfPage) => {
|
||||
return this._parsePageSize(pdfPage.pageSizeInches);
|
||||
return this._parsePageSize(getPageSizeInches(pdfPage));
|
||||
}),
|
||||
]);
|
||||
}).then(([info, metadata, fileName, fileSize, creationDate, modDate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue