These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

richValue

rlaughma
Registered: Oct 25 2007
Posts: 6

I am working with multiline form fields and would like to vertically center the text string. It appears that this is possible by using richValue and the spans object. However, I can not find any documentation on the spans[n].property that will allow such formatting. Any information on where to find the spec or if this is possible would be much appreciated! Thank You in advance.

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Take a look in the Acrobat JavaScript Reference at the "Span" object. It has an "allignment" property. There is a spans object example in the strikethough property.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

rlaughma
Registered: Oct 25 2007
Posts: 6
Per page 605 of 692 @ [url=http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf]http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/javascript/AcroJS.pdf[/url]
The Horizonatal alignment is listed as a property of the Spans object. However there is no reference to the Vertical alignment of the text. It at first appears to not be supported by Adobe javascript.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What do you know, it's not in there:(

There are lots of undocumented entries for the Span Object. One way to see what's going on is to use the "toSource()" fucntion. Like this

var cSpn = this.getField("Text1").richValue.toSource();

Just change a few Rich Text parameters like text color, alignment, etc. Then run this code from the JavaScript Console Window.

Reset the capured state with this code

this.getField("Text1").richValue = eval(cSpn)

I didn't see a vertical alignment parameter and when I restored the saved state the text reverted to "Top Vertical" instead of "center vertical" aligment, showing that the vertical alignment is not saved.

Bummer

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script