Skip to content
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

Current version does not seem to work, in none browsers!! #9526

Closed
ghost opened this issue Mar 4, 2018 · 12 comments
Closed

Current version does not seem to work, in none browsers!! #9526

ghost opened this issue Mar 4, 2018 · 12 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2018

Attach (recommended) or Link to PDF file here:
http://cdn.mozilla.net/pdfjs/helloworld.pdf

Configuration:

  • Web browser and its version: chrome, edge, firefox - most current versions! (Feb. 04. 2018)
  • Operating system and its version: win10 x64 prof
  • PDF.js version: most current from http://mozilla.github.io/pdf.js/build/pdf.worker.js, linked in the source
  • Is a browser extension: no

Steps to reproduce the problem:

  1. Visit that page: https://mozilla.github.io/pdf.js/examples/
  2. Click on "Result"
  3. It results in an empty rectangle, no content

What is the expected behavior? (add screenshot)
That it shows the PDF's content "Hello, world!" (http://cdn.mozilla.net/pdfjs/helloworld.pdf) in the rectangle!

What went wrong? (add screenshot)
https://image.ibb.co/hUz1JS/Unbenannt.jpg

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
https://mozilla.github.io/pdf.js/examples/

@ghost
Copy link
Author

ghost commented Mar 4, 2018

  • disable "Popup Blocker Pro" in Chrome does also not solve the problem!!

@ghost ghost changed the title Does not work, in no browsers Current version does not seem to work, in none browsers!! Mar 4, 2018
@ghost
Copy link
Author

ghost commented Mar 4, 2018

  • Safari 5.1.7 (last version for windows) can't open the page, so i can't test with it..

@ghost
Copy link
Author

ghost commented Mar 4, 2018

  • Opera does also not work!!

@p3sn
Copy link

p3sn commented Mar 5, 2018

So strange, I have untouched my code and suddenly this error. I see the same error on the example pages as well.

Reproduced it, visit: http://mozilla.github.io/pdf.js/examples/index.html#interactive-examples
Chrome 64.0.3282.186 on Mac.
Click on a result tab in the examples, see console error: Uncaught ReferenceError: PDFJS is not defined at window.onload ((index):61)

In Safari it says: ReferenceError: Can't find variable: PDFJS

@p3sn
Copy link

p3sn commented Mar 5, 2018

I changed my code to:

<script src="//mozilla.github.io/pdf.js/build/pdf.js"></script>
<script>
    'use strict';
    var PDFJS = {};
    PDFJS.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
    console.log(PDFJS);
</script>

Next error is: PDFJS.getDocument is not a function

@p3sn
Copy link

p3sn commented Mar 5, 2018

Solution: download a version from 10 days ago and host it yourself: https://github.com/mozilla/pdfjs-dist/tree/ba20b1adfcad8a5d9f6126b37062d52f3bd524b2

@p3sn
Copy link

p3sn commented Mar 5, 2018

The 'good' solution is to replace PDFJS with pdfjsDistBuildPdf.
So:
pdfjsDistBuildPdf.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
and
pdfjsDistBuildPdf.getDocument({data: pdfData});

The problem occurred after this commit: b8606ab

@jmar83the3rd
Copy link

(Github always lock my accounts when i enter wrong login informations, because of that i now created one account more...;) "Please wait a while and try again later." -> And WTF means "a while"...?? A minute, a hour, a day, a week, a month...?)

In your case, i would change the example's source on https://mozilla.github.io/pdf.js/examples/

I still can't believe that im the 1st person who realize that the example source code is wong...;)

However, thank you for your feedbacks. Will try it as soon as possible...

@chirag64
Copy link

chirag64 commented Mar 5, 2018

I reported the same thing in #9525 but it was closed as invalid :( . Basically they broke backward compatibility.

@ghost
Copy link
Author

ghost commented Mar 5, 2018

Oh, i didn't saw that.

@timvandermeij
Copy link
Contributor

timvandermeij commented Mar 5, 2018

Two days ago we merged the pull request that removed the global PDFJS object. This is targeted for version 2.0, which is not officially released yet, so make sure to pin your version to 1.x until it is. The official release is tracked in #9521, the documentation about the backwards incompatible changes is tracked in #9528 and updating the JSFiddle examples is tracked in #9529, so I'm closing this issue in favor of those more specific issues. Note that this is being worked on right now and we hope to update the examples ASAP.

Edit: We also have #9440 to more clearly state that it is a nightly build and should be pinned by consumers.

@timvandermeij
Copy link
Contributor

The examples have been fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants