Update downloader.js

This commit is contained in:
Anthony Stirling 2024-11-20 10:23:29 +00:00 committed by GitHub
parent a22ce69bc3
commit d19d87b8f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -99,6 +99,7 @@
async function getPDFPageCount(file) { async function getPDFPageCount(file) {
try { try {
const arrayBuffer = await file.arrayBuffer(); const arrayBuffer = await file.arrayBuffer();
pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdfjs-legacy/pdf.worker.mjs'
const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise; const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise;
return pdf.numPages; return pdf.numPages;
} catch (error) { } catch (error) {