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

Re: Field doesn't export as formatted

hammer09
Acrobat 9
Registered: May 19 2006
Posts: 15

Hi Thom, Thanks for replying to my previous question about getting my custom format script to export what the content is formatted to. I put all of my code inside of the if(event.willCommit) command as you indicated. However, when I do that, the script no longer formats my text. I did this in the Custom Format Script window. Did you do something incorrectly? Thanks again for your help!

Chad Chelius
Chelius Graphic Services
chad [at] cheliusgraphicservices [dot] com

My Product Information:
Acrobat Pro 7, Macintosh
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You want to set the value of the field when it is being commited. So the first line of the Keystroke script should be

if(event.willCommit)

You have a lot of code here so it is difficult to debug. Start out with a single line to make sure you've got everything ok. Like this.

if(event.willCommit)
event.value += "Hello There";

You cannot have any other code on this field for formatting, keystroke, etc. that will interfere with this.

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

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

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

hammer09
Acrobat 9
Registered: May 19 2006
Posts: 15
Thom,
when you say:
You cannot have any other code on this field for formatting, keystroke, etc. that will interfere with this.

does that mean that it isn't possible to custom format text that is entered into a field and then commit it to export as formatted?

Chad Chelius
Chelius Graphic Services
chad [at] cheliusgraphicservices [dot] com