Which product are you using?
PDF.js Express
PDF.js Express Version
8.7.4
Detailed description of issue
I am using pdf.js express with my Nuxt3 application. I have installed pdf.js express with npm and copied the static files from node_modules/@pdftron/pdfjs-express/public to my Nuxt application public/lib folder. Everything was working fine when I run in the node server in browser, but when I try to run a build version of my Nuxt application I was not able to open any pdf file, showing net::ERR_ABORTED 404 (Not Found) error
Code snippet
//Components/WebViewer/index.vue
<template>
<div id='webviewer' ref='viewer'></div>
</template>
<script>
export default {
name: 'WebViewer',
props: {
path: String,
url: String
},
mounted: function () {
import('@pdftron/pdfjs-express').then(() => {
WebViewer({
path: '../lib',
initialDoc: this.url, // replace with your own PDF file
licenseKey: '',
}, this.$refs.viewer).then((instance) => {
// call apis here
});
})
}
}
</script>
<style>
#webviewer {
height: 100vh;
}
</style>
And the error I get in my console after running the build version: