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

Separe word to characters

palces
Registered: Nov 25 2010
Posts: 22

Hello.
I have one pdf form, where is field for example name, but I need parse word to boxes. How it is possible do?
 
I was try create fdf file for pdf document.
Characters are parse correct if I add space after each character.
For example If I have name JOHN, i need it in fdf file write like "J O H N".
Is it possible formating with javascript?
 
Can you write for me example, how it is working?
The best way is show me working javascript code and how I can write it to adobeacrobat...
 
Thanks

My Product Information:
Acrobat Pro 9.4, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Do you need a single string with each letter separated by a space, or an array of characters?
Have a look here for reference of the methods available in JS for String objects:
http://www.w3schools.com/jsref/jsref_obj_string.asp

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

palces
Registered: Nov 25 2010
Posts: 22
Only single string separate by space.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Let's say the original string is called "str". If you use this code the new varibale "newStr" will contain the original string with spaces between each letter:

var newStr = "";
for (i=0; i<(str.length-1); i++) {
newStr += str.charAt(i) + " ";
}
newStr += str.charAt(i);

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

palces
Registered: Nov 25 2010
Posts: 22
And how I can settup it?
I have pdf form with field caled "dan".
These javascript writ to format -> custom format and add these javascript?
I am working on it first time.
I need detail isntruction (first time).