Parsing text in a TextBox
Copy link to clipboard
Copied
Good Day,
I am hoping I can get some help using JavaScript. I have a 10 page PDF document with multiple fill in boxes for users to fill in on a Ipad using Acrobat Reader DC.
I am currently using Acrobat Pro DC and in the 1st page, the user copies an Email received from dispatch. Using a button, I want to take this data and parse out the Invoice #, Physical Address, and telephone number so I can use this variable to fill in the other pages of the PDF. Example of a pasted Email;
Invoice 1234567
Address 23 Main St
San Marco Ca
99002
Telephone 901-111-1212
Variable example;
var Invoice = 1234567
var Address = 23 Main St
var City = San Marco
var State = CA
Var Zip = 99002
Var Phone = 901-111-1212
Thank you.
Copy link to clipboard
Copied
You can split the value by lines (see: JavaScript String split() Method) and then parse each string as necessary (removing the "Telephone " text, for example), and apply each line to a different field. However, I don't think it's going to work on an iPad, but you can try...
Copy link to clipboard
Copied
Thank you try67! Even though you pointed me in the right direction, I was able to use the JS substr function to perform the text extraction.

