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

Form field text values too large #7367

Closed
BHSPitMonkey opened this issue May 27, 2016 · 6 comments · Fixed by #12828
Closed

Form field text values too large #7367

BHSPitMonkey opened this issue May 27, 2016 · 6 comments · Fixed by #12828

Comments

@BHSPitMonkey
Copy link

Link to PDF file (or attach file here): detect-form-fields.pdf

Configuration:

  • Web browser and its version: Firefox 46.0.1
  • Operating system and its version: Ubuntu 16.04
  • PDF.js version: 1.3.231
  • Is an extension: No

Steps to reproduce the problem:

  1. Open PDF
  2. Look at entered text in form sections 8a and 9a

What is the expected behavior? Text is correct size:

screenshot from 2016-05-27 12-32-04

What went wrong? Text is very large:

screenshot from 2016-05-27 12-30-58

PdfBug console output:

11:56:13.291 PDF ef2293a3b9f4e0accbef97ee38798a2c [1.3 Mac OS X 10.11.1 Quartz PDFContext / Amgraf OneForm Designer Plus] (PDF.js: 1.3.231)1 viewer.js:6800:7
11:56:13.292 Warning: AcroForm/XFA is not supported1 viewer.js:6824:9
11:56:13.424 Warning: Unimplemented annotation type "FreeText", falling back to base annotation1 pdf.worker.js:9407:5
11:56:13.806 Warning: fontRes not available1 pdf.worker.js:9407:5 (logged 54 times)
11:56:13.898 Warning: Error during font loading: Font Helvetica-Bold is not available1 pdf.js:368:5
@hveit
Copy link

hveit commented Sep 17, 2019

I have a similiar problem, but I do not yet know what to do about it:
If this is a problem with AcroForms support within PDF.js, why is this ticket (https://github.com/mozilla/pdf.js/projects/1) resolved/closed while this one here is still open?

I can still reproduce this in version 2.3.171.
Is there a chance to circumvent the problem somehow, i.e. by installing fonts etc.?

@THausherr
Copy link
Contributor

THausherr commented Sep 17, 2019

The problem with the file here is that the appearance streams are missing. /NeedAppearances is set so the viewer should generate them. In the field "f1_13(0)" the /DA (default appearance) is "/Helvetica-Bold 9 Tf 0 g". However the font "Helvetica-Bold" does not exist in in the Acroform default resources of the PDF (I suspect that the PDF was poorly merged from a cover page and the original SS4 form). So PDF.js makes some decision about what font to use, and from the screeenshot this looks like Comic Sans 🤣

@hveit make sure that the software that generates / fills the PDF also creates the appearance streams of the fields. If you're not sure what is going on, create a new issue here.

@hveit
Copy link

hveit commented Sep 17, 2019

@THausherr thanks for the explanation.
Can you confirm, that it is the same problem with my PDF file from issue #11151?

@THausherr
Copy link
Contributor

THausherr commented Sep 17, 2019

@hveit I'll answer there. It is somewhat different, in that PDF the font is available in the AcroForm default resources.

@automatedbugreportingfacility

This looks much better now, but the values are cut off a little:

form

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

Successfully merging a pull request may close this issue.

7 participants
@BHSPitMonkey @timvandermeij @Snuffleupagus @automatedbugreportingfacility @THausherr @hveit and others