vue-pdf 4.0.6 library not work properly with vuejs version 2.
See original GitHub issueI 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 second
this.imageFileURL = pdf.createLoadingTask(URL.createObjectURL(imageFileObject))
.
here, imageFileObject
variable provide file object from input
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,
- Machine and library details:
- vue-pdf 4.0.6
- vue.js 2.3.3
- webpack 2.6.1
- browser chrome 70.0.3538.110
- AWS EBS
- Python 2.7 with Django 1.8
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
vue-pdf doesn't refresh on src change - Stack Overflow
It works fine on the first run and the first file is loaded and displayed successfully. But once clicked on another file name...
Read more >Vue.js - The Progressive JavaScript Framework | Vue.js
Vue.js - The Progressive JavaScript Framework. ... A rich, incrementally adoptable ecosystem that scales between a library and a full-featured framework.
Read more >vue-pdf - npm
vue.js pdf viewer. Latest version: 4.3.0, last published: 2 years ago. Start using vue-pdf in your project by running `npm i vue-pdf`.
Read more >vue-pdf vulnerabilities - Snyk
version published direct vulnerabilities
4.3.0 17 Jun, 2021 0. C. 0. H. 0. M. 0. L
4.2.0 14 Oct, 2020 0. C. 0. H. 0....
Read more >Vue.js - Bountysource
Debugging in VS Code and Chrome not working with TypeScript $ 0 ... Created 4 years ago in vuejs/vue-cli with 24 comments. Version....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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:@jpbferreira Thanks for information.
I tried to find
#.worker.js
. but, no luck. I found something likevar PdfjsWorker = require('worker-loader!pdfjs-dist/build/pdf.worker.js');
undervuePdfNoSss.vue
andvuePdfSss.vue
. Could you give me more information for how you managed?