Open deepenpatel19 opened 5 years ago
Did you get any progress on this issue? I'm having the same trouble running in production server, but can't figure it out.
@deepenpatel19 we managed to get it to work. There is a file called '(hash).worker.js' that wasn't being downloaded during the requests due to permission restriction we configured in SpringBoot. It looks like this file has some settings used by vue-pdf. I Hope it can help you in some way.
@jpbferreira Thanks for information.
I tried to find #.worker.js
. but, no luck.
I found something like var PdfjsWorker = require('worker-loader!pdfjs-dist/build/pdf.worker.js');
under vuePdfNoSss.vue
and vuePdfSss.vue
.
Could you give me more information for how you managed?
Not sure if this would solve, but I encountered a similar problem elsewhere with web workers, which are used by the core layer of the underlying PDF.js library.
Assuming you're using webpack, loading worker files requires:
worker-loader
as a project dependancyvue.config.js
file in the root folder with the following code to make sure the loader bundles the worker files correctly:module.exports = {
configureWebpack: {
output: {
globalObject: 'this',
},
},
}
Hi, I have same issue ... Have you solved this issue ? When my app was compiled, I've no fetch request to get PDF preview but in local dev, 'fetch" method was sent.
Thanks
I followed your examples and successfully run in local environment except production and development server. I'm not able to preview of pdf file on those servers.
I tried two ways to preview pdf files and as listed below. First,
this.imageFileURL = URL.createObjectURL(imageFileObject)
and secondthis.imageFileURL = pdf.createLoadingTask(URL.createObjectURL(imageFileObject))
. here,imageFileObject
variable provide file object frominput
method of javascript.In addition, I would like to add how I imported library and register component. how I import is,
import pdf from 'vue-pdf'
then register component like,pdf: pdf,