diff --git a/src/core/catalog.js b/src/core/catalog.js index a5355ad57..9a19e45e9 100644 --- a/src/core/catalog.js +++ b/src/core/catalog.js @@ -1085,7 +1085,7 @@ class Catalog { }); } - getPageDict(pageIndex, skipCount = false) { + getPageDict(pageIndex) { const capability = createPromiseCapability(); const nodesToVisit = [this._catDict.getRaw("Pages")]; const visitedNodes = new RefSet(); @@ -1153,7 +1153,7 @@ class Catalog { throw ex; } } - if (Number.isInteger(count) && count >= 0 && !skipCount) { + if (Number.isInteger(count) && count >= 0) { // Cache the Kids count, since it can reduce redundant lookups in // documents where all nodes are found at *one* level of the tree. const objId = currentNode.objId; diff --git a/src/core/document.js b/src/core/document.js index bc33b1952..21607253a 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -1388,7 +1388,7 @@ class PDFDocument { let pageIndex = 1; // The first page was already loaded. while (true) { try { - await this.getPage(pageIndex, /* skipCount = */ true); + await this.getPage(pageIndex); } catch (reasonLoop) { if (reasonLoop instanceof PageDictMissingException) { break;