I am trying to implement Mozilla’s PDF.js into an Ionic 3 App, I installed pdfjs-dist and the typings from dt.
I can correctly import and call the library functions but It does not work because the web-worker is not found:
GET http://localhost:8100/build/main.worker.js 404 (Not Found)
PDFWorker_initialize @ pdf.js:2842
PDFWorker @ pdf.js:2815
getDocument @ pdf.js:2266
PdfEditorPage @ pdf-editor.ts:18
createClass @ core.es5.js:10873
createDirectiveInstance @ core.es5.js:10701
createViewNodes @ core.es5.js:12064
createRootView @ core.es5.js:11969
callWithDebugContext @ core.es5.js:13184
debugCreateRootView @ core.es5.js:12644
ComponentFactory_.create @ core.es5.js:9890
ComponentFactoryBoundToModule.create @ core.es5.js:3427
NavControllerBase._viewInit @ nav-controller-base.js:564
(anonymous) @ nav-controller-base.js:356
t.invoke @ polyfills.js:3
onInvoke @ core.es5.js:4128
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
(anonymous) @ polyfills.js:3
t.invokeTask @ polyfills.js:3
onInvokeTask @ core.es5.js:4119
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
o @ polyfills.js:3
invoke @ polyfills.js:3
The only comment about I found is this one in other thread
But the OP does not responded.
Does anybody can point me out in the right direction? I am not sure where and how to import the web worker. I have not found any main.worker.js
file.
Thanks