-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Windows 10: PDF is not rendered correctly #16839
Comments
There seems to be something wrong with the
Here both Lines 2696 to 2711 in c72cb54
Please actually fill out this part of the ISSUE_TEMPLATE when reporting an issue! |
I can't reproduce the issue on mac with either Firefox or Chrome. |
Same for me. Provided pdf is not rendered correctly on Win 10. Any updates regarding this issue? |
This comment was marked as duplicate.
This comment was marked as duplicate.
The maxp table for the non-rendered font has a version number equals to 0x100 which is very likely wrong: |
If the version number is less than 0x00010000 (e.g. an example reported at mozilla/pdf.js#16839 apparently has 0x0100), it will be treated as version 0.5 and only the num_glyphs field is kept. However, this can prevent the font working on Windows, which apparently requires the full maxp table for truetype fonts. So if the version number was bad, but there is in fact enough data to parse as version 1.0, let's try correcting it to 1.0 rather than 0.5.
If the version number is less than 0x00010000 (e.g. an example reported at mozilla/pdf.js#16839 apparently has 0x0100), it will be treated as version 0.5 and only the num_glyphs field is kept. However, this can prevent the font working on Windows, which apparently requires the full maxp table for truetype fonts. So if the version number was bad, but there is in fact enough data to parse as version 1.0, let's try correcting it to 1.0 rather than 0.5.
If the version number is less than 0x00010000 (e.g. an example reported at mozilla/pdf.js#16839 apparently has 0x0100), it will be treated as version 0.5 and only the num_glyphs field is kept. However, this can prevent the font working on Windows, which apparently requires the full maxp table for truetype fonts. So if the version number was bad, but there is in fact enough data to parse as version 1.0, let's try correcting it to 1.0 rather than 0.5. Also make the max_zones fixup more general, as the example font from the above issue has max_zones=512(!). Correcting it to 2 should be harmless.
If the version number is less than 0x00010000 (e.g. an example reported at mozilla/pdf.js#16839 apparently has 0x0100), it will be treated as version 0.5 and only the num_glyphs field is kept. However, this can prevent the font working on Windows, which apparently requires the full maxp table for truetype fonts. So if the version number was bad, but there is in fact enough data to parse as version 1.0, let's try correcting it to 1.0 rather than 0.5. Also make the max_zones fixup more general, as the example font from the above issue has max_zones=512(!). Correcting it to 2 should be harmless.
If the version number is not explicitly v0.5 (0x00005000), try to read it as v1.0. (The version field will be corrected to one of the valid versions during serialization.) This handles cases where the table was intended to be v1.0 (for a font with TrueType data), but the version field was set incorrectly (e.g. to 0x00000100, as seen in mozilla/pdf.js#16839). Also make the max_zones fixup more general, as the example font from the above issue has max_zones=512(!). Correcting it to 2 should be harmless.
Attach (recommended) or Link to PDF file here:
250125_010823.pdf
Configuration:
Chrome/Firefox
Windows 10
Actually used react-pdf, so tested 3.6 and demo version
No
Steps to reproduce the problem:
What is the expected behavior? (add screenshot)
What went wrong? (add screenshot)
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/web/viewer.html
The text was updated successfully, but these errors were encountered: