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 size shrinking and expanding in Text Fields as per text length. #1548

Open
2 tasks done
thehamzajunaid opened this issue Nov 17, 2023 · 0 comments
Open
2 tasks done

Comments

@thehamzajunaid
Copy link

thehamzajunaid commented Nov 17, 2023

What were you trying to do?

I wanted a text field which can show my text using a predefined font size. If the the text field is small to show all my text then I was expecting to have a "keyboard down press button" functionality to scroll through the text. My text is multiline and sometimes single line.

How did you attempt to do it?

page.drawText('Some Title: ', { x: fieldX, y: 650, size: 12});
const textField = form.createTextField("favourite.stringValueFromBackend");
textField.enableMultiline();
if(stringValueFromBackend){
textField.setText(stringValueFromBackend)
}
textField.addToPage(page, { x: fieldX, y: 630, width: fieldWidth, height: 15 });

What actually happened?

image

You can see the squeezed text with a very small font size. Title and Output fields are also of the same height.

What did you expect to happen?

image

I was expecting something like this where I can scroll my text content using keyboard down press key.

How can we reproduce the issue?

The above code that I have provided is enough to execute it.

Version

^1.17.1

What environment are you running pdf-lib in?

Node

Checklist

  • My report includes a Short, Self Contained, Correct (Compilable) Example.
  • I have attached all PDFs, images, and other files needed to run my SSCCE.

Additional Notes

No response

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

1 participant