Created
April 3, 2019 20:39
-
-
Save LuisHCK/ba87bb633148d12f9ad184e2fc800d14 to your computer and use it in GitHub Desktop.
PDF.js get loading percent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loadingTask = window.PDFJS.getDocument(documentUrl); | |
loadingTask.onProgress = ({loaded, total}) => { | |
// do something here | |
const percentLoaded = Math.round((loaded * 100) / total); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment