Skip to main content
Participant
Nov 28, 2022 11:43 PM UTC
Question

How to programmatically set the font size to "auto"?

Hello,

 

I'd like to implement a PDF form filler that supports text auto-sizing/shrinking. Is there a syntax for natively setting the font size to auto? I've tried:  '/Helv 0 Tf'' but get quirky behaviors - the inputted text is there but it doesn't show up in screen. I'm only able to see the text after clicking into the text box in my PDF viewer.

 

Any advice? Attached is an animated GIF of the behaviors.


Thank you.

This topic is closed to new replies. Start a new post to keep the conversation going.

10 replies

Legend
Nov 29, 2022 9:07 PM UTC

What is "raw ISO language"? Do you mean you are hand coding the PDF?

If so, just use Acrobat to make an Auto field and see what it does.

Translate
Participant
Nov 29, 2022 9:29 PM UTC

Yes hand-coded. The field is set to auto. What should the DA be set to so it honors the auto-sizing? I've tried font size 0 - the text is there but it does not display on screen.

Translate
Legend
Nov 30, 2022 9:21 AM UTC

As I suggested, just use Acrobat to make a form with auto sizing, then investigate what it put in the file.

Translate
Bernd Alheit
Community Expert
Community Expert
Nov 29, 2022 6:38 AM UTC

What API does you use?

Translate
Participant
Nov 29, 2022 8:03 PM UTC

I don't have API, i'm encoding in raw ISO language. Do you have any suggestions for API?

Translate
Participant
Nov 28, 2022 11:45 PM UTC

Oh, and here is the PDF.

Translate