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

Error: Warning: name token is longer than allowed by the spec: 141 #10871

Closed
SwatiMaheshwari opened this issue May 30, 2019 · 4 comments
Closed

Comments

@SwatiMaheshwari
Copy link

Attach (recommended) or Link to PDF file here:

Configuration:

  • Web browser and its version:chrome
  • Operating system and its version:windows
  • PDF.js version: latest
  • Is a browser extension: no

Steps to reproduce the problem:

  1. Uploading Pdf gives follwing error in console and few pages appear blank

What is the expected behavior? (add screenshot) pdf should be rendered

What went wrong? (add screenshot)error in console and pdf not rendered properly
Error: Warning: name token is longer than allowed by the spec: 134

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented May 30, 2019

Attach (recommended) or Link to PDF file here:

Without this information the issue will be closed as INVALID, since there's unfortunately no actionable information provided here.

PDF.js version: latest

You need to provide the actual version number when reporting an issue, since "latest" can mean any number of things (e.g. current master version, current beta/release version) and is also of no use in e.g. a weeks time.


Error: Warning: name token is longer than allowed by the spec: 134

Also, as can be seen in the code this isn't a breaking error but rather just a warning:

pdf.js/src/core/parser.js

Lines 1006 to 1008 in d0892e4

if (strBuf.length > 127) {
warn(`Name token is longer than allowed by the spec: ${strBuf.length}`);
}

That was changed in PR #6193, almost four years ago, which suggests that the "PDF.js version: latest" claim above wasn't even remotely correct...

@SwatiMaheshwari
Copy link
Author

I have the above code in my parser.js. I am getting error from pdf.worker.js.
Also some pages of pdf are getting blank on load.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented May 31, 2019

I have the above code in my parser.js. I am getting error from pdf.worker.js.

Did you actually read all of #10871 (comment), since it mentions that you're using a several years out-of-date version of the PDF.js library?

You'll need to update to the latest version, as found at https://github.com/mozilla/pdf.js/releases, and this issue will be resolved. Keep in mind that only the latest version is officially supported.

@timvandermeij
Copy link
Contributor

Closing because of the reasons above and the fact that without a PDF file it will not be possible to look into this.

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

3 participants