Skip to content

Commit

Permalink
Merge pull request #95 from aryan-debug/master
Browse files Browse the repository at this point in the history
Added onProgress callback #88
  • Loading branch information
vinodnimbalkar authored Jan 5, 2025
2 parents 664435a + 85b7adb commit 3bcc840
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/PdfViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
export let totalPage = 0
export let downloadFileName = ''
export let showTopButton = true // boolean
export let onProgress = undefined
pdfjs.GlobalWorkerOptions.workerSrc = new URL( 'pdfjs-dist/build/pdf.worker.mjs', import.meta.url).toString();
Expand Down Expand Up @@ -165,6 +166,8 @@
...(data && { data }),
...(password && { password }),
})
loadingTask.onProgress = onProgress
loadingTask.promise
.then(async function (pdfDoc_) {
pdfDoc = pdfDoc_
Expand Down

0 comments on commit 3bcc840

Please sign in to comment.