Skip to content

Commit

Permalink
update: loadingtask to use new promise based api from pdfjs
Browse files Browse the repository at this point in the history
fix issue #30
  • Loading branch information
arkokoley committed Apr 1, 2020
1 parent c7fce98 commit 2eef486
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Pdfvuer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
this.fetch = function (query) {
return import('raw-loader!pdfjs-dist/cmaps/' + query.name + '.bcmap' /* webpackChunkName: "noprefetch-[request]" */)
return import('raw-loader!pdfjs-dist/cmaps/' + query.name + '.bcmap' /* webpackChunkName: "pdfjs/noprefetch-[request]" */)
.then(function (bcmap) {
return {
Expand All @@ -45,7 +45,7 @@
};
var loadingTask = pdfjsLib.getDocument(source);
var loadingTask = await pdfjsLib.getDocument(source).promise;
loadingTask.__PDFDocumentLoadingTask = true; // since PDFDocumentLoadingTask is not public
if (options && options.onPassword)
Expand Down

2 comments on commit 2eef486

@nicholaszuccarelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line has broken building my app for me.
It says that: "you cannot use keyword 'await' outside of an async function"

@arkokoley
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicholaszuccarelli working on fixing this.

Please sign in to comment.