I am loading PDFTron web viewer in my angular 7 application. I am able to load PDFTron web viewer template in UI but while loading sample PDF file I am getting the error below.
I am getting 404 file not found error while loading .res file(https://localhost:5001/dist/webviewer/lib/core/pdf/pdfnet.res). but I have that .res file in that dist folder location. I have loaded js file that is in the same folder am able to load that (https://localhost:5001/dist/webviewer/lib/core/pdf/PDFworker.js)
I am thinking that issue with loading MIME types, I configured these MIME types in web config added path angular.json file and added MIME types in local IIS as well
I tried adding MIME types in below areas but no luck.
- Added in Web.config, Appsettings files and added path in angular.json file.
- And I added these .nmf .res and other required MIME types in my local IIS as well.
- I added in MIME types in mime-db in node modules (Usually we don’t touch this node modules but I tried, whether this making any problem but this also not worked).
added in angular.json file like below
"assets": [
"src/assets",
"src/dist/assets",
"src/webviewer",
"src/files",
"src/dist/webviewer",
"src/dist/files",
"src/web.config",
"src/dist/web.config"
],
I created sample angular application from CLI, and integrated this PDFTron webviewer and it worked perfectly . Able to load PDF files in webviewer.
I am running my angular application build mode, while taking files from dist folder am facing these issues.(404 File not found and MIME file types not set issue).