mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Convert PDFDocumentLoadingTask
, in src/display/api.js
, to an ES6 class
Also deprecates the `then` method, in favour of the `promise` getter.
This commit is contained in:
parent
5f15dc2023
commit
ef8e5fd77c
14 changed files with 82 additions and 68 deletions
|
@ -57,7 +57,8 @@ var pdfURL = '../../../web/compressed.tracemonkey-pldi-09.pdf';
|
|||
var rawData = new Uint8Array(fs.readFileSync(pdfURL));
|
||||
|
||||
// Load the PDF file.
|
||||
pdfjsLib.getDocument(rawData).then(function (pdfDocument) {
|
||||
var loadingTask = pdfjsLib.getDocument(rawData);
|
||||
loadingTask.promise.then(function(pdfDocument) {
|
||||
console.log('# PDF document loaded.');
|
||||
|
||||
// Get the first page.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue