1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

[api-minor] Refactor the annotation code to be asynchronous

This commit is the first step towards implementing parsing for the
appearance streams of annotations.

Co-authored-by: Jonas Jenwald <jonas.jenwald@gmail.com>
Co-authored-by: Tim van der Meij <timvandermeij@gmail.com>
This commit is contained in:
dmitryskey 2018-03-20 20:43:40 -04:00 committed by Tim van der Meij
parent c8ee63319d
commit 3741becb9b
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
4 changed files with 482 additions and 432 deletions

View file

@ -723,9 +723,9 @@ var WorkerMessageHandler = {
}
);
handler.on('GetAnnotations', function wphSetupGetAnnotations(data) {
return pdfManager.getPage(data.pageIndex).then(function(page) {
return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]);
handler.on('GetAnnotations', function({ pageIndex, intent, }) {
return pdfManager.getPage(pageIndex).then(function(page) {
return page.getAnnotationsData(intent);
});
});