Loading pdf.js in node projects

artydev - Oct 22 - - Dev Community

I have struggled to import pdf.js in my project.

Here is what I have done to make it work :

npm install pdfjs-dist
Enter fullscreen mode Exit fullscreen mode

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;
Enter fullscreen mode Exit fullscreen mode

Hope this help

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player