Merge pull request #14181 from PinRathod/simpleviewer_to_async
Converted simpleviewer.js to await/async
This commit is contained in:
commit
390ddd9241
@ -92,10 +92,11 @@ const loadingTask = pdfjsLib.getDocument({
|
|||||||
cMapPacked: CMAP_PACKED,
|
cMapPacked: CMAP_PACKED,
|
||||||
enableXfa: ENABLE_XFA,
|
enableXfa: ENABLE_XFA,
|
||||||
});
|
});
|
||||||
loadingTask.promise.then(function (pdfDocument) {
|
(async function () {
|
||||||
|
const pdfDocument = await loadingTask.promise;
|
||||||
// Document loaded, specifying document for the viewer and
|
// Document loaded, specifying document for the viewer and
|
||||||
// the (optional) linkService.
|
// the (optional) linkService.
|
||||||
pdfViewer.setDocument(pdfDocument);
|
pdfViewer.setDocument(pdfDocument);
|
||||||
|
|
||||||
pdfLinkService.setDocument(pdfDocument, null);
|
pdfLinkService.setDocument(pdfDocument, null);
|
||||||
});
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user