Skip to main content
Participant
April 11, 2019
Answered

JS - Detect filled or overflown textfield

  • April 11, 2019
  • 1 reply
  • 437 views

I try to work with variable font size in multiline textfield. The auto font size property is insufficient because i want to specify a max and min font size (default seems to be 12 and 4 respectively).

Since there appears a marker and scrollbar once a textfield starts to overflow or input is disabled on non scrollable textfields, i had the idea to implement a custom javascript solution. However i was unable to find a property or event which conforms to this described beahviour in the javascript documentation.

Perhaps someone can point me in the right direction or otherwise can confirm that indeed there is no such feature.

Cheers.

This topic has been closed for replies.
Correct answer Thom Parker

There are no min/max font size options, but there is a "fieldFull" property of the event object. Here's the reference entry:

Acrobat DC SDK Documentation

It's tricky to use. But a script can detect when a field overflows, modify the field parameters and try to re-detect if the field is still over. The key concept is that this is tricky stuff.

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
April 11, 2019

There are no min/max font size options, but there is a "fieldFull" property of the event object. Here's the reference entry:

Acrobat DC SDK Documentation

It's tricky to use. But a script can detect when a field overflows, modify the field parameters and try to re-detect if the field is still over. The key concept is that this is tricky stuff.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often