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

Text not shown properly, possibly a font problem #11151

Closed
hveit opened this issue Sep 16, 2019 · 9 comments
Closed

Text not shown properly, possibly a font problem #11151

hveit opened this issue Sep 16, 2019 · 9 comments

Comments

@hveit
Copy link

hveit commented Sep 16, 2019

The attached PDF file does not show properly, when rendered with PDF.js. The console log shows fonts warnings.
I am not sure if this is a problem in the PDF file or in PDF.js.

Attach (recommended) or Link to PDF file here:
937-Unfall.pdf

Configuration:

  • Web browser and its version: Google Chrome Version 77.0.3865.75 (Offizieller Build) (64-Bit)
  • Operating system and its version: Win 7 Enterprise SP1
  • PDF.js version: 1.10.100
  • Is a browser extension:

Steps to reproduce the problem:

  1. Upload and open the attached PDF file to PDF.js Demo on https://mozilla.github.io/pdf.js/web/viewer.html
  2. Some text is out of place, too large, possibly due to wrong font used

What is the expected behavior? (add screenshot)
Google Chrome seems to render text correctly:
ScreenshotChrome

As does Adobe Acrobat Reader DC:
ScreenshotAcrobatReader

What went wrong? (add screenshot)
Some text is out of place, too large:
ScreenshotPDFJSOnlineDemo

Browser console log shows font warnings:
ScreenshotConsoleWarning

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

@timvandermeij
Copy link
Contributor

Closing since this is a duplicate of #7367 where not being able to load the fonts for AcroForms causes font substitution.

@THausherr
Copy link
Contributor

THausherr commented Sep 17, 2019

I looked at field "4006" (Bearbeiter) and that one doesn't have an appearance stream. /NeedAppearances is set so the viewer should create it. /DA is "/QuickPDFF3ce08b65 10 Tf 0 0 0 rg" and the font "QuickPDFF3ce08b65" is available in the AcroForm default resources and fully embedded ("Root/AcroForm/DR/Font/QuickPDFF3ce08b65/FontDescriptor/FontFile2") so no font substitution should be needed.

Thus I wonder whether PDF.js looks at the AcroForm default resources.

@hveit
Copy link
Author

hveit commented Sep 17, 2019

@THausherr thanks for your analysis.
So this issue doesn't seem to be a duplicate of issue #7367 after all and thus should be reopened?
Unfortunately I do not seem to be able to do this here...

@THausherr
Copy link
Contributor

Yeah IMHO this should be reopened. Alternatively a look / explanation whether PDF.js uses the fonts in AcroForm/DR/Font.
@timvandermeij

@timvandermeij
Copy link
Contributor

I have re-opened this since it seems to be a bit different, but I think the underlying cause is the same, namely that we don't do anything yet with the fonts from the AcroForm dictionary.

@hveit
Copy link
Author

hveit commented Sep 18, 2019

@timvandermeij thank you for clarifying.

@escapewindow
Copy link
Contributor

This appears to be resolved if I set renderInteractiveForms to true.

@hveit
Copy link
Author

hveit commented Jul 6, 2020

This appears to be resolved if I set renderInteractiveForms to true.

This works for me as well: The font problem seems to disappear, setting this option to true.
In this case all fields in my example PDF file are editable. This seems to be correct, since Adobe Acrobat reader shows it the same way.
Now my question is:
Is there some option/switch in PDF.js to show an AcroForm readonly, regardless of the readonly states of the fields within the PDF file? Something like a readonly mode for AcroForms? Or has something like this to be done always within the PDF file itself?

@timvandermeij
Copy link
Contributor

Closing since this is fixed now with and without forms rendering, likely after #12828.

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

No branches or pull requests

4 participants