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

Changing Font in Field

wbthompson
Registered: Oct 15 2008
Posts: 5

Hello,

I have created a business card template.

I was wondering if I can change the font after a ",'?

Example

Joe Smith, MBA

I would like to change the MBA font size and font type.

Can this be done?

Thanks
Brad

My Product Information:
Acrobat Pro 9.1.1, Macintosh
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You will have to use the 'richText' field property, but you will need to create the text in another application and then cut and paste it into the form field, or write some custom JavaScript to create the spanned object of the different text formats.

George Kaiser

wbthompson
Registered: Oct 15 2008
Posts: 5
gkaiseril,

Thank you for responding so quickly.

If I would like to use a formatting script how would I go about creating the syntax for this situation?

Will a formatting script work if you are using a script in the Custom Calculation Tab to combine text into a new string?

Thank you for your help!
Brad
wbthompson
Registered: Oct 15 2008
Posts: 5
This is starting to drive me around the bend. So I have created a span which you can see below. It doesn't work any suggestion on what I did wrong. The value it return is Object.

Where should I place this script (format tab, Calculation tab, or Document level)?

Thank you for any input.


var spans = new Array();

spans[0] = new Object();
spans[0].alignment ="center";
spans[0].text = [this.getField('EnglishName').value];
spans[0].fontStyle = "italic";
spans[0].textColor = color.red;

spans[1] = new Object();
spans[1].alignment = "center";
spans[1].text = [this.getField('EnglishAcc').value];
spans[1].fontStyle = "italic";
spans[1].textColor = color.red;

var f = this.getField("Text4");
f.value = spans;
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Once a text field is setup for Rich Text you can use the Properties Bar to change the font, color, size, etc. of any piece of selected text. Use the "View > Toolbars > Properties..." menu item.Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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