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:
commit
c40a0a6478
1 changed files with 8 additions and 10 deletions
|
@ -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),
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue