I have struggled to import pdf.js in my project.
Here is what I have done to make it work :
npm install pdfjs-dist
in Javascript file :
import * as pdfjsLib from "pdfjs-dist/legacy/build/pdf.mjs";
import * as workerURL from "pdfjs-dist/legacy/build/pdf.worker.min.mjs"
pdfjsLib.GlobalWorkerOptions.workerURL = workerURL;
Hope this help
Top comments (0)