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) {
|
handler.on("GetPageIndex", function wphSetupGetPageIndex({ ref }) {
|
||||||
var ref = Ref.get(data.ref.num, data.ref.gen);
|
const pageRef = Ref.get(ref.num, ref.gen);
|
||||||
var catalog = pdfManager.pdfDocument.catalog;
|
return pdfManager.ensureCatalog("getPageIndex", [pageRef]);
|
||||||
return catalog.getPageIndex(ref);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
handler.on("GetDestinations", function wphSetupGetDestinations(data) {
|
handler.on("GetDestinations", function wphSetupGetDestinations(data) {
|
||||||
@ -507,7 +506,7 @@ class WorkerMessageHandler {
|
|||||||
});
|
});
|
||||||
|
|
||||||
handler.on("GetStats", function wphSetupGetStats(data) {
|
handler.on("GetStats", function wphSetupGetStats(data) {
|
||||||
return pdfManager.pdfDocument.xref.stats;
|
return pdfManager.ensureXRef("stats");
|
||||||
});
|
});
|
||||||
|
|
||||||
handler.on("GetAnnotations", function ({ pageIndex, intent }) {
|
handler.on("GetAnnotations", function ({ pageIndex, intent }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user