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

PDF Files (Docx Type) failing to render in IE11 #8884

Closed
sameerg10 opened this issue Sep 7, 2017 · 4 comments · Fixed by #9900
Closed

PDF Files (Docx Type) failing to render in IE11 #8884

sameerg10 opened this issue Sep 7, 2017 · 4 comments · Fixed by #9900
Labels

Comments

@sameerg10
Copy link

sameerg10 commented Sep 7, 2017

Our company is designing a document viewer/indexing web app that would allow users to view images (pdfs) and input data based on what information is in the image. There is a web service at our company that takes the ID of an image and converts it to PDF for viewing. I'm using this service along with PDFJS to render the images and display them in our custom web app. When a docx file (or xls) file is converted to PDF, it displays fine on chrome. However, when tested on IE11, it fails to render correctly and just shows a blank white page. I tried including compatibility.js to the index.html file but receive an error:

"Expected identifier, string or number
File: compatibility.js, Line: 100, Column: 10"

Configuration:

  • Web browser and its version: IE11
  • Operating system and its version: Windows 7
  • PDF.js version: 2.0

Steps to reproduce the problem:

  1. convert a docx file to pdf
  2. open converted pdf file in IE 11

What is the expected behavior? correctly rendered pdf (like in Chrome)

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Sep 7, 2017

PDF.js version: 2.0

No such version of PDF.js exists (the current one is 1.9.528, as of this writing).

As it currently stands, this issue is missing too many of the required details to be actionable!
At the very least the problematic PDF file must be attached to the issue; see also https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md.

I tried including compatibility.js to the index.html file but receive an error:

"Expected identifier, string or number
File: compatibility.js, Line: 100, Column: 10" -- apologies for not adding a screenshot, doesnt seem to be working.

As mentioned in e.g. https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support, compatibility.js is now included by default in generic builds and shouldn't be included manually.

Finally, if you try to open your PDF file in the demo viewer (by using the "Open file" button on the right-hand side of the toolbar) available at https://mozilla.github.io/pdf.js/web/viewer.html, does that work?

@sameerg10
Copy link
Author

sameerg10 commented Sep 7, 2017

Hi,
https://github.com/sameerg10/PDFTest/blob/master/attachment.pdf
Above is a link to the file that is failing to render (wasn't allowing me to attach it here). Note: it is a pdf file and this renders correctly in chrome but not in IE11. It also renders correctly using the Adobe plugin in both IE11 and Chrome (just fails rendering in PDFJS).

Edit: I tried opening the PDF file in demo on https://mozilla.github.io/pdf.js/web/viewer.html and it didn't work showing how this is a real issue for compatibility in IE11 (it also resulted in a blank page).

Thanks

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Sep 7, 2017

https://github.com/sameerg10/PDFTest/blob/master/attachment.pdf

Renders just fine for me, when opening with https://mozilla.github.io/pdf.js/web/viewer.html in IE 11 (on Windows 7).
I do however see one error in the console, that I've never encountered before, that may explain the issue. (Since it works for me I'd assume that the error is ignored, perhaps depending on certain settings in IE!?)

XML5632: Only one root element is allowed. Rad: 24, kolumn 20

@sameerg10
Copy link
Author

sameerg10 commented Sep 7, 2017

Yeah it doesn't seem to render at all for me and I get this in the console log:

Unhandled rejection: TypeError: Unable to get property 'pdfPage' of undefined or null reference
TypeError: Unable to get property 'pdfPage' of undefined or null reference
   at Anonymous function (https://mozilla.github.io/pdf.js/web/viewer.js:4362:15)
   at runHandlers (https://mozilla.github.io/pdf.js/build/pdf.js:7863:17)

XML5632: Only one root element is allowed. Line: 24, Column 20

Also would like to add that the version of IE11 I'm running is 11.0.9600.18762CO

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