Skip to content

Commit

Permalink
Added onProgress callback vinodnimbalkar#88
Browse files Browse the repository at this point in the history
  • Loading branch information
aryan-debug committed Jan 3, 2025
1 parent 664435a commit 85b7adb
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 85b7adb

Please sign in to comment.