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 Does Not Autofit While Editing #15605

Open
lavlicekian opened this issue Oct 20, 2022 · 5 comments
Open

Text Does Not Autofit While Editing #15605

lavlicekian opened this issue Oct 20, 2022 · 5 comments

Comments

@lavlicekian
Copy link

I'm not sure if Autofit is the correct term, and haven't been able to find reports of this online. I'm guessing there's a setting I've missed somewhere.

Attach (recommended) or Link to PDF file here:
Direct_Deposit_Authorization_2019.pdf

Configuration:

  • Web browser and its version: Firefox 104.0.2 (64-bit)
  • Operating system and its version: Windows 11 Enterprise 21H2 22000.978
  • PDF.js version: 2.15.303
  • Is a browser extension: No

Steps to reproduce the problem:

  1. When typing out the alphabet part of it will be cut off from view while editing the document in Firefox.
  2. When typing out the alphabet in Chrome, Edge, and Brave, the text in the field will automatically shrink to keep the whole alphabet visible while editing.
  3. The text is automatically scaled correctly when the document is printed to paper or PDF.

What is the expected behavior?
image

What went wrong?
image

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

@calixteman calixteman self-assigned this Oct 20, 2022
@calixteman
Copy link
Contributor

The field has a font where its size is zero which means that the font is auto-sized. From the specs:

A zero value for size means that the font shall be auto-sized: its size
shall be computed as a function of the height of the annotation rectangle.

which became in the last version:

A zero value for size means that the font
shall be auto-sized: its size shall be computed as an implementation dependent function.

Since Acrobat and Chrome are using both dimensions (i.e. width and height), I guess we should do the same.

@PailaGH
Copy link

PailaGH commented Jan 4, 2024

@calixteman Do you have plans to implement this soon?

@calixteman
Copy link
Contributor

Yep it's a WIP and it's working pretty well.
I just need identify possible corner cases and check how it behaves when printing/saving.

@PailaGH
Copy link

PailaGH commented Jan 4, 2024

Great. Thank you.

@PailaGH

This comment was marked as duplicate.

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