-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The API version "2.3.45" does not match the Worker version "2.1.266 #10997
Comments
|
I have this issue as well, and I don't believe it has anything to do with what you're saying @timvandermeij ....
Please help. Working with PDFJS has been a nightmare. |
Given the lack of enough details here, I'm going by what you wrote and it seems to have everything to do with what I wrote earlier because you're also mixing versions here! The error is pretty clear: you're installing |
I appreciate the response--so what should I be referencing with |
And when I add |
Looking at the various examples, for example https://github.com/mozilla/pdf.js/blob/50bc4a18e8c564753365d927d5ec6a6d2cce3072/examples/components/pageviewer.js, that should be enough. Without a running example there is not much we can do to help since it may very well be caused by something else in your code. I'd suggest to try running the examples first, see if that works and go from there. |
I know this issue is closed but I want to share my solution for those who have this problem. |
For me, I use CDN and found that <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.6.347/build/pdf.min.js"></script>
<script>
...
// Loaded via <script> tag, create shortcut to access PDF.js exports.
var pdfjsLib = window['pdfjs-dist/build/pdf'];
// The workerSrc property shall be specified.
pdfjsLib.GlobalWorkerOptions.workerSrc = '//cdn.jsdelivr.net/npm/pdfjs-dist@2.6.347/build/pdf.worker.js';
...
</script> |
Fix for any release. Now use pdfjs without CDN and no Worker version error anymore.Goto: there are four files
Download Extract
Now add
So, now you will never face any conflict of versions. because |
Hi, I updated the source code following your instruction, but it can not solve my problem. Can you give me your example source code? |
@hainguyenvan6799 Hi. |
I had this issue in React, Check the worker url specified in the worker component.
"pdfjs-dist": "^2.16.105", mke sure its the same version as of package.json. solved it for me . |
I have tried to find a worker for 2 days. |
see this answer, hope this helps you |
pdfjs.GlobalWorkerOptions.workerSrc = 'https://unpkg.com/pdfjs-dist@2.16.105/build/pdf.worker.js'; works for me |
Attach (recommended) or Link to PDF file here:
Configuration:
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
What went wrong? (add screenshot)
When calling loadingTask.promise
Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
The text was updated successfully, but these errors were encountered: