Skip to content

Commit f61b74e

Browse files
Merge pull request #14325 from Snuffleupagus/getPageDict-rm-skipCount
Remove the unused `skipCount` parameter from `Catalog.getPageDict` (PR 14311 follow-up)
2 parents d9e0de8 + 8ea740c commit f61b74e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/core/catalog.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ class Catalog {
10851085
});
10861086
}
10871087

1088-
getPageDict(pageIndex, skipCount = false) {
1088+
getPageDict(pageIndex) {
10891089
const capability = createPromiseCapability();
10901090
const nodesToVisit = [this._catDict.getRaw("Pages")];
10911091
const visitedNodes = new RefSet();
@@ -1153,7 +1153,7 @@ class Catalog {
11531153
throw ex;
11541154
}
11551155
}
1156-
if (Number.isInteger(count) && count >= 0 && !skipCount) {
1156+
if (Number.isInteger(count) && count >= 0) {
11571157
// Cache the Kids count, since it can reduce redundant lookups in
11581158
// documents where all nodes are found at *one* level of the tree.
11591159
const objId = currentNode.objId;

src/core/document.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ class PDFDocument {
13881388
let pageIndex = 1; // The first page was already loaded.
13891389
while (true) {
13901390
try {
1391-
await this.getPage(pageIndex, /* skipCount = */ true);
1391+
await this.getPage(pageIndex);
13921392
} catch (reasonLoop) {
13931393
if (reasonLoop instanceof PageDictMissingException) {
13941394
break;

test/unit/api_spec.js

+8
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,14 @@ describe("api", function () {
457457
const pdfDocument = await loadingTask.promise;
458458
expect(pdfDocument.numPages).toEqual(1);
459459

460+
const page = await pdfDocument.getPage(1);
461+
expect(page instanceof PDFPageProxy).toEqual(true);
462+
463+
const opList = await page.getOperatorList();
464+
expect(opList.fnArray.length).toEqual(0);
465+
expect(opList.argsArray.length).toEqual(0);
466+
expect(opList.lastChunk).toEqual(true);
467+
460468
await loadingTask.destroy();
461469
});
462470

0 commit comments

Comments
 (0)