Merge pull request #12276 from Snuffleupagus/worker-ensure
Access the `XRef`/`Catalog` data correctly in the "GetStats"/"GetPageIndex" handlers in `src/core/worker.js`
This commit is contained in:
commit
525cc733d2
@ -438,10 +438,9 @@ class WorkerMessageHandler {
|
||||
});
|
||||
});
|
||||
|
||||
handler.on("GetPageIndex", function wphSetupGetPageIndex(data) {
|
||||
var ref = Ref.get(data.ref.num, data.ref.gen);
|
||||
var catalog = pdfManager.pdfDocument.catalog;
|
||||
return catalog.getPageIndex(ref);
|
||||
handler.on("GetPageIndex", function wphSetupGetPageIndex({ ref }) {
|
||||
const pageRef = Ref.get(ref.num, ref.gen);
|
||||
return pdfManager.ensureCatalog("getPageIndex", [pageRef]);
|
||||
});
|
||||
|
||||
handler.on("GetDestinations", function wphSetupGetDestinations(data) {
|
||||
@ -507,7 +506,7 @@ class WorkerMessageHandler {
|
||||
});
|
||||
|
||||
handler.on("GetStats", function wphSetupGetStats(data) {
|
||||
return pdfManager.pdfDocument.xref.stats;
|
||||
return pdfManager.ensureXRef("stats");
|
||||
});
|
||||
|
||||
handler.on("GetAnnotations", function ({ pageIndex, intent }) {
|
||||
|
Loading…
Reference in New Issue
Block a user