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

Trouble with opening PDFs with non-ASCII characters #8937

Closed
wojtekmaj opened this issue Sep 20, 2017 · 5 comments
Closed

Trouble with opening PDFs with non-ASCII characters #8937

wojtekmaj opened this issue Sep 20, 2017 · 5 comments
Labels

Comments

@wojtekmaj
Copy link
Contributor

Link to PDF file (or attach file here):
23.pdf

Configuration:

  • Web browser and its version: Any
  • Operating system and its version: Windows 10
  • PDF.js version: 1.9.577, likely does not matter
  • Is an extension: No

What is the expected behavior? (add screenshot)

I have a package that makes a bridge between pdf.js and React, react-pdf. Recently I was informed that the file attached above does not render correctly.
I tested the file in my project and in pdf.js online viewer to confirm. It did not work on my project, worked correctly on online viewer. However, I've noticed that online viewer makes additional server requests while opening the file, which fail on my project.

  • What is the file it's trying to load?
  • Can I somehow make it work with Webpack without the need to force my users to manually add the files to their projects?
  • And finally, why baseUrl was null in the first place and why the request was not stopped because of it?

What went wrong? (add screenshot)

image

image

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

http://projekty.wojtekmaj.pl/react-pdf/test

@yurydelendik
Copy link
Contributor

Here is what we do to configure demo viewer https://github.com/mozilla/pdf.js/blob/master/web/app.js#L51-L64

Try specifying cMapUrl/cMapPacked globals.

@yurydelendik
Copy link
Contributor

yurydelendik commented Sep 20, 2017

What is the file it's trying to load?

External CMap files that can be referred from some PDFs (similar to non-embedded fonts). They are not included into the main code due to their size

Can I somehow make it work with Webpack without the need to force my users to manually add the files to their projects?

The files need to be present, so PDF.js can lazily fetch them when need. Sorry, we don't have JSONP option yet (loading from CDN). Somebody welcome to work on it.

And finally, why baseUrl was null in the first place and why the request was not stopped because of it?

No reason. Adding the null-check before issuing a request or, even better, using "always fails" CMapReaderFactory will be a good addition to the PDF.js core library.

@gilgen
Copy link

gilgen commented Sep 28, 2017

What is the cause of the null baseUrl, though? I am running into this as well. When I specify a PDFJS.cMapUrl the change doesn't seem to take effect as I still get the 404 on the odd url:

image

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 5, 2017

No reason. Adding the null-check before issuing a request or, even better, using "always fails" CMapReaderFactory will be a good addition to the PDF.js core library.

Can we close this as fixed by PR #8962, or are additional changes required here?

@timvandermeij
Copy link
Contributor

Yes, I would say so. If more changes are required now that the validation is implemented, please open a new issue with all required details.

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

No branches or pull requests

5 participants