1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Merge pull request #19137 from Snuffleupagus/PDFDocumentProperties-move-getPage

Move the `getPage` call in `PDFDocumentProperties` class
This commit is contained in:
Tim van der Meij 2024-12-01 14:44:43 +01:00 committed by GitHub
commit c40a0a6478
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,12 +112,13 @@ class PDFDocumentProperties {
}
// Get the document properties.
const {
info,
/* metadata, */
/* contentDispositionFilename, */
contentLength,
} = await this.pdfDocument.getMetadata();
const [
{ info, /* metadata, contentDispositionFilename, */ contentLength },
pdfPage,
] = await Promise.all([
this.pdfDocument.getMetadata(),
this.pdfDocument.getPage(currentPageNumber),
]);
const [
fileName,
@ -131,10 +132,7 @@ class PDFDocumentProperties {
this.#parseFileSize(contentLength),
this.#parseDate(info.CreationDate),
this.#parseDate(info.ModDate),
// eslint-disable-next-line arrow-body-style
this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {
return this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation);
}),
this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation),
this.#parseLinearization(info.IsLinearized),
]);