Is there a way to adjust the rectangle size of a textField to fit the actual content?
I need to bordered a textfield with variable content using a autoadjust size border.
Any hint will be highly appreciated.
Our standard version is acrobat reader 7.0
var f = this.getField("myText");
var aRect = f.rect;// get bounding rectangle
f.multiline = true;// make it multiline
var height = aRect[1]-aRect[3];// calculate height
aRect[3] -= 2* height;// triple the height of the text field
f.rect = aRect;// and make it so
Here's another option:
If the text field is filled up by the user, allow additional text by setting the field to scroll.
if ( event.fieldFull )
{
app.alert("You've filled the given space with text,"
+ " and as a result, you've lost some text. I'll set the field to"
+ " scroll horizontally, and paste in the rest of your"
+ " missing text.");
this.resetForm([event.target.name]); // reset field to lose focus
event.target.doNotScroll = false;// make changes
if ( event.target.richText )
event.richChange = event.richChangeEx
else
event.change = event.changeEx;
}
Hope this helps.
My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.