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

Warning: FormatError: Required "loca" table is not found in Internet Explorer #9514

Closed
jurgentreep opened this issue Feb 27, 2018 · 5 comments · Fixed by #9520
Closed

Warning: FormatError: Required "loca" table is not found in Internet Explorer #9514

jurgentreep opened this issue Feb 27, 2018 · 5 comments · Fixed by #9520
Labels

Comments

@jurgentreep
Copy link

Attach (recommended) or Link to PDF file here:
http://edelman.amsterdam/wp-content/uploads/Terms_Conditions_NL.pdf

Configuration:

  • Web browser and its version: Internet Explorer 11 version 11.248.16299.0
  • Operating system and its version: Windows 10 Home version 1709 build 16299.248
  • PDF.js version: 2.0.391
  • Is a browser extension: no

Steps to reproduce the problem:

  1. Render the pdf in internet explorer

What is the expected behavior? (add screenshot)
The pdf renders like it does in Chrome
Image of pdf in Chrome

What went wrong? (add screenshot)
The pdf doesn't render the font correctly and renders all sorts of random characters.
Image of pdf in Internet Explorer

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):
If the information provided isn't enough I'm willing to create an example.

@DanDeMicco
Copy link

+1 seeing same issue

tonyjin pushed a commit to tonyjin/box-content-preview that referenced this issue Feb 27, 2018
tonyjin added a commit to box/box-content-preview that referenced this issue Feb 27, 2018
@janpe2
Copy link
Contributor

janpe2 commented Feb 27, 2018

This may be related to issue #9516.

pdf.js/src/core/fonts.js

Lines 1319 to 1321 in 97faedb

if (!VALID_TABLES.includes(table.tag)) {
continue; // skipping table if it's not a required or optional table
}

The polyfilled Array.prototype.includes() always returns false, so all TrueType tables are skipped.

@timvandermeij
Copy link
Contributor

timvandermeij commented Feb 27, 2018

Could someone check if Array.prototype.includes() is provided by IE11? The polyfill only kicks in if Array.prototype.includes() is undefined, but perhaps IE11 ships its own (broken) version instead. (I don't have an instance of IE11 around to test this myself.)

@janpe2
Copy link
Contributor

janpe2 commented Feb 27, 2018

IE11 does not seem to provide that function
kuva

If I open the PDF.js demo viewer, then I get:
kuva

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Feb 28, 2018

It appears that both Array.includes and String.includes are affected here.
Since https://github.com/zloirock/core-js are used for a number of existing polyfills in compatibility.js, it might be an issue with how we're attempting to load these specific ones in

// Provides support for String.prototype.includes in legacy browsers.
// Support: IE, Chrome<41
(function checkStringIncludes() {
if (String.prototype.includes) {
return;
}
String.prototype.includes = require('core-js/fn/string/includes');
})();
// Provides support for Array.prototype.includes in legacy browsers.
// Support: IE, Chrome<47
(function checkArrayIncludes() {
if (Array.prototype.includes) {
return;
}
Array.prototype.includes = require('core-js/fn/array/includes');
})();

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

Successfully merging a pull request may close this issue.

5 participants