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

Content in some text widgets are not visible #14301

Closed
calixteman opened this issue Nov 24, 2021 · 5 comments · Fixed by #14936
Closed

Content in some text widgets are not visible #14301

calixteman opened this issue Nov 24, 2021 · 5 comments · Fixed by #14936

Comments

@calixteman
Copy link
Contributor

calixteman commented Nov 24, 2021

Attach (recommended) or Link to PDF file here:
formulairecerfa90nov00-1.pdf
or here: http://mdph.cotesdarmor.fr/pdf/formulaires/formulairecerfa90nov00.pdf

Configuration:

  • Web browser and its version: Firefox nightly
  • Operating system and its version: Windows 10 pro

Steps to reproduce the problem:

  1. Go to page 2:
    image
    Enter a number in each fields (the input is supposed to be a single number)
  2. It's impossible to read what it has been entered, so it isn't possible to check that the inputs are correct and consequently the user will very likely use another pdf viewer.

What is the expected behavior? (add screenshot)
image

What went wrong? (add screenshot)
image

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Nov 24, 2021

The naive solution would be to just decrease the vertical padding to e.g. 1px in


However, without running tests I suppose that could break other things and we may perhaps need to limit that to only textWidgetAnnotation-elements and/or even just "short" fields!?

@calixteman
Copy link
Contributor Author

And very likely, at some point, in a particular case, 3px was a good value so setting it to 1px will fix this issue and likely will break another pdf.
For a "normal" text field I don't really see the point to have this padding or maybe it is only useful for comb fields.

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Nov 24, 2021

Given that this issue seems to be (somewhat of) a special-case, how about simply using a CSS-class to set the padding to e.g. padding: 0 1px; specifically for textWidgetAnnotation-inputs where the width is e.g. shorter than ~15 pixels?
That should be a very targeted fix, thus reducing the risk of regressing anything else in the process.

@calixteman
Copy link
Contributor Author

calixteman commented Nov 28, 2021

@timvandermeij, do you have an idea on what could be a good solution ? and maybe you could remember why you chose this 3.
Anyway I'm fine with @Snuffleupagus' solution.

@timvandermeij
Copy link
Contributor

I see that I introduced the 3px value in e686db2. Back then we didn't have the associated test yet, but I did add that later and I recall having used the same document for the development of this patch, so I'd say if https://github.com/mozilla/pdf.js/blob/master/test/pdfs/annotation-text-widget.pdf still renders correctly (i.e., very similar to Adobe Reader) then changing the 3px should be fine.

@calixteman calixteman linked a pull request May 20, 2022 that will close this issue
calixteman added a commit to calixteman/pdf.js that referenced this issue May 20, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 20, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 20, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 28, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
calixteman added a commit to calixteman/pdf.js that referenced this issue May 28, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
bh213 pushed a commit to bh213/pdf.js that referenced this issue Jun 3, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
rousek pushed a commit to signosoft/pdf.js that referenced this issue Aug 10, 2022
- right now we're using the font size from the pdf itself but we use an other font
  in the annotation layer. So this size doesn't really make sense and leads to bad
  rendering (see pdf in mozilla#14928);
- use a sans-serif font for the fields containing text (fix issue mozilla#14736);
- remove useless padding in text-based fields (fix issue mozilla#14301);
- text fields allow/disallow scrolling bars (see bit 24 in Ff entry), so use this
  value to hide/show scrollbars in annotation layer.
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.

3 participants