feat: upgrade pdfjs-dist from 3.x to 5.x for improved PDF viewer

Update worker path from .js to .mjs to match the new ESM-only build
structure in pdfjs-dist v5. Core API (getDocument, getPage, render)
remains compatible.
This commit is contained in:
2026-03-04 15:28:07 +05:30
parent 824f659e13
commit bf67156b9c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -4182,7 +4182,7 @@ let isPdfViewerActive = false; // Track if PDF viewer is currently shown
// Initialize PDF.js
const pdfjsLib = require('pdfjs-dist');
pdfjsLib.GlobalWorkerOptions.workerSrc = require.resolve('pdfjs-dist/build/pdf.worker.js');
pdfjsLib.GlobalWorkerOptions.workerSrc = require.resolve('pdfjs-dist/build/pdf.worker.mjs');
// Open PDF file
async function openPdfFile(filePath) {