jbtje / vite-vue3pdf Goto Github PK
View Code? Open in Web Editor NEWvue3 PDF reader to be used with Vite
License: MIT License
vue3 PDF reader to be used with Vite
License: MIT License
Hi
I have an issue that occurs in browsers in iOS devices (Safari and WebViews), version iOS 15.3 and lower.
TypeError: Ee.split("+").at is not a function. (In 'Ee.split("+").at(-1)', 'Ee.split("+").at' is undefined)
That breaks all other scripts execution.
- vue3pdf version: 0.2.0
- vue.js version: 3.2.45
- vite version: 4.0.0
- browser version: 15.3 (same a iOS version I guess)
- OS version: iOS 15.3 and lower
Any chance for quick fix? I tried to go over it but no luck so far, and my deadline for it is just now.
Thanks in advance!
This error occurs when using createLoadingTask
.
pdf.js?v=3922a56a:15917 Uncaught (in promise) Error: No "GlobalWorkerOptions.workerSrc" specified.
at get workerSrc [as workerSrc] (pdf.js?v=3922a56a:15917:12)
at PDFWorker._initialize (pdf.js?v=3922a56a:15757:10)
at new PDFWorker (pdf.js?v=3922a56a:15730:11)
at Object.getDocument (pdf.js?v=3922a56a:14676:70)
at Object.createLoadingTask (pdfjsWrapper.js?v=3922a56a:34:54)
@jbtje/vite-vue3pdf v0.2.0
vite v4.5.0
vue v3.3.6
An idea. It would be nice to expose the option to make text selectable. Doesn't seem very hard to implement.
Would you add please the option to specify the worker location, instead of default '/pdfjs/pdf.worker.js'?
If possible ASAP as it's urgent for me.
Thanks!
Hi,
We are using your library as we had to upgrade an app from vue2 to vue3 and needed a version of vue-pdf that was compatible.
I am encountering an intermittent issue - It is more noticeable on the firefox browser but it has happened on both chrome and edge also, unfortunately there is no pattern to the issue. We use your library to "view" a PDF data on the canvas and then take snaps (canvas.toDataURL) of this canvas to store as an image each time a page is loaded.
Below is the pdf component that we use in our app
<div ref="capture" id="pdfPlaceholder" v-if="fileData && fileDataLoadedAndAvailable === true">
<pdf :src="fileData" :page="pageToShow" worker-src="/tools/vue-claims/pdfjs/pdf.worker.js"
@num-pages="listenNumPages" @error="handlePDFLoadError" @page-loaded="handlePDFPageLoaded">
</pdf>
</div>
I am noticing intermittently, that page-loaded event is triggered - and I can see the canvas on the screen but it has a height and width of 0 - there is no data on the canvas. Image attached showing blank canvas in the dom.
Sometimes, on second attempt of the file upload, the canvas will be populated.
We have tried a number of fixes :
Is there anyway to re-try the page-loaded step if the data is blank first time around? Is there something we are missing in our setup to make this work consistently?
More info can be provided if needed, any help appreciated. Thanks!
Edit : just to add some more info, on multipage documents - the first canvas might be blank but the subsequent pages are populated in the canvas.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.