Copy link to clipboard
Copied
Hello,
I have a PDF with a form field. The form field isn't large enough to contain every value that could be entered into it, so we want to let the users continue to enter text and have that text shrink to fit the field.
However, if the text is shrinking to below 6 pt. font, we want to prevent the user from entering any new text into the field. I'm running into issues trying to find a clean and consistent way to enforce this.
The business is determined to proceed with this approach, so I thought I'd check in and see if anyone in this community knows of an elegant approach to this problem.
Assistance is greatly appreciated!
Copy link to clipboard
Copied
As the custom validation script you can use something like this (for example):
if (event.value.length>100) event.target.textSize = 10;
else if (event.value.length>50) event.target.textSize = 8;
else event.target.textSize = 6;
Copy link to clipboard
Copied
You can limit the number of characters entered into the field. You can't
limit the size of the font, if you've selected the Auto option.
On Wed, Jun 7, 2017 at 4:57 PM, bobs91524144 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
As I suspected, it sounds like Adobe doesn't have a combination of settings that can achieve the effect that I'm looking for. Does anyone use a workaround or perhaps Javascript in order to achieve this?
Otherwise, am I forced to set the font to Auto so that the text shrinks, then manually identify the character limit that ensures the text doesn't shrink below 6pt?
Copy link to clipboard
Copied
Can anyone please confirm? I realize the functionality is not built into Adobe, but can this be achieved via Javascript?
Thanks you!
Copy link to clipboard
Copied
You can use a script to set a specific font size depending on the length of the text the user enters, but it won't change while they are typing, only when they exit the field.
Copy link to clipboard
Copied
That sounds encouraging. What would the script be to achieve that effect?
Copy link to clipboard
Copied
As the custom validation script you can use something like this (for example):
if (event.value.length>100) event.target.textSize = 10;
else if (event.value.length>50) event.target.textSize = 8;
else event.target.textSize = 6;
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more