JS - Detect filled or overflown textfield

Apr 11, 2019

Copy link to clipboard

Copied

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.

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

78

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

JS - Detect filled or overflown textfield

Apr 11, 2019

Copy link to clipboard

Copied

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.

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

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.

TOPICS
Acrobat SDK and JavaScript, Windows

Views

79

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 11, 2019 0
Adobe Community Professional ,
Apr 11, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 11, 2019 2