I used pdf.js directly in angular app for some pdf purposes. It works fine.
I imported the pdfjs from the pdfjs-dist and my package.json includes pdfjs-dist.
I solved this by including the pdf.worker.js file in the bundle much the same way as assets are stored.
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "pdf.worker.*",
"input": "node_modules/pdfjs-dist/build/",
"output": ""
}
],
Then you need to
import * as pdf from 'pdfjs-dist';
// ... //
pdf.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
const loadingTask = pdf.getDocument({ data: this.pdfData });