mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +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
|
@ -37,11 +37,12 @@ var SCALE = 1.0;
|
|||
var container = document.getElementById('pageContainer');
|
||||
|
||||
// Loading document.
|
||||
pdfjsLib.getDocument({
|
||||
var loadingTask = pdfjsLib.getDocument({
|
||||
url: DEFAULT_URL,
|
||||
cMapUrl: CMAP_URL,
|
||||
cMapPacked: CMAP_PACKED,
|
||||
}).then(function(pdfDocument) {
|
||||
});
|
||||
loadingTask.promise.then(function(pdfDocument) {
|
||||
// Document loaded, retrieving the page.
|
||||
return pdfDocument.getPage(PAGE_TO_VIEW).then(function (pdfPage) {
|
||||
// Creating the page view with default parameters.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue