I am designing a form where as I am asked to specify the character limit to the user (person filling out the form) right on the form. I know I can set a character LIMIT in properties but I am not quite sure how to figure out what the limit is. Meaning, there is a predetermined space (this form was imported) and how to determine what number of characters would fit in it without doing it manually.
I am not familiar with how to write code or use it to automate items. It's on my to learn list but this form has a deadline.
Thanks to all who contribute to this forum. I learn a lot!
Or, since you said the text entry space is predefined, you need to find out how many characters will fit into it with a given font. Fill the field with the widest character, such as "W", at the desired font and font size, and then count them. For example, if the field was named "TextArea" then this code, run from the console window, returns the number of characters entered into the field.
this.getField("TextArea").valueAsString.count;
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script