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

How do I use Multi-lined text fields over "printed line" area of existing form

jiman
Registered: Jan 12 2011
Posts: 1
Answered

I have an existing InDesign file (for Print) that needs to be converted into a PDF form. Where I have multi-line response areas I find I either have to create text fields for each line (which is a pain) or I can create a multi-lined text field however I can't find a way to control the leading of the text which means the text runs over the background "printed lines" in the document.
 
The client is a bank and wants the PDF form to look identical to the printed version so I can't delete the lines.
 
There are two possible solutions I can think of, but don't know if either are possible.
 
1) Find a way to control the leading of the the multi-lined text field so the text can be aligned to the underlying lines on the page,
 
or
 
2) Set individual boxes, for each line, that auto flow to each other once the previous line is filled (i.e. without requiring to tab between fields).
 
Now, are either of these options possible (even if this it's a function of LiveCycle Designer) or does someone else out there have an alternative fix?
 
Thanks
JM

My Product Information:
Acrobat Pro 9.0, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
1) There's no leading option for these text boxes. You can create a script, however, that automatically adds a certain amount of spaces in the beginning of the text, using a custom format script.

2) Yes, that's possible by checking if the field is full and then using the setFocus method to jump to the next one. Search the forums. It was discussed several times.

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

smit462
Registered: May 20 2006
Posts: 20
I've run into a similar situation with the preprinted lines in a multi-line area. We've wanted to keep the lines for individuals who complete the form by hand and have them disappear for those typing into the fields.

Our solution was to create 2 fields over the preprinted lines:

The 1st field is a solid white, read-only, hidden field placed directly over the lines. Because it's set to "hidden," it doesn't show when the form opens.

The 2nd field is a multi-line text block with actions set so that, on Focus, it's set to show the hidden white field that then covers up the lines. We also put a "Reset Form" button at the top of the form that clears all the fields and re-hides the white field, so the lines show again.

STEVE MITTEL
Senior Forms Designer
Texas Comptroller of Public Accounts

maxwyss
Registered: Jul 25 2006
Posts: 255
Accepted Answer
This has been a long time issue with many of the forms I have done for my clients.

In almost all cases, it boiled down to the question why there were those writing lines, and the conclusion was that the lines were here to help the user write in their text.

Now, if you fill out the form on screen, you don't need those guide lines at all, and the text is way more readable as well.

So, we came to the conclusion that when the form is filled out on screen, we don't need those lines, and we treat each of these fields with the following Format script:

if (event.value.toString().length > 0) {
event.target.fillColor = color.white ;
} else {
event.target.fillColor = color.transparent ;
}

So, if the field is empty, the lines will show through, and the form can be printed and filled out manually. If the field is not empty, the lines will be covered up, and we don't have to worry about them anymore.

HTH.

Max Wyss.

maggie_lee
Registered: Feb 18 2011
Posts: 2
I am currently dealing with this exact problem in Acrobat. Thanks for the script, Max. When I use it, the write-on rules do indeed disappear, but not until I click out of the form field after typing. Is there a way to make the rules disappear the moment text is added to a form field (rather than after I click out of the box)?
maxwyss
Registered: Jul 25 2006
Posts: 255
It is possible, but you might have to be careful that it does not interfere with other onBlur activities.

In the onFocus event, you add this line of code:

event.target.fillColor = color.white ;


and in the onBlur event, you will add this line of code:

if (event.value.toString().length < 1) {
event.target.fillColor = color.transparent ;
}


The onBlur event script is needed to set back the field's background to transparent when you tab through an empty field; when you tab through a field, the Format event does not occur.

HTH.

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
maxwyss wrote:
This has been a long time issue with many of the forms I have done for my clients.In almost all cases, it boiled down to the question why there were those writing lines, and the conclusion was that the lines were here to help the user write in their text.

Now, if you fill out the form on screen, you don't need those guide lines at all, and the text is way more readable as well.

So, we came to the conclusion that when the form is filled out on screen, we don't need those lines, and we treat each of these fields with the following Format script:

if (event.value.toString().length > 0) {
event.target.fillColor = color.white ;
} else {
event.target.fillColor = color.transparent ;
}

So, if the field is empty, the lines will show through, and the form can be printed and filled out manually. If the field is not empty, the lines will be covered up, and we don't have to worry about them anymore.

HTH.

Max Wyss.
I'm doing exactly the same thing for my forms !
;-)
maggie_lee
Registered: Feb 18 2011
Posts: 2
Thank you, Max! Your solution works perfectly!
Kazdyn
Registered: May 1 2011
Posts: 2
I know this post is kind of old, but I was really happy to find this information so easily. However, I am having the same problem maggie_lee was having at first with the text box not replacing the lines until I click out and back into the text box.

I tried the code variation for onFocus and onBlur, but it seems to act the same.

I'm wondering if I am using an older version of acrobat (CS3) and this is what the issue is.

I also can't get the box to replace the lines AT ALL when I open this file in Preview (Mac os X). Will the code only work when opened with Acrobat?

I'll look around the Forum for more information, but I haven't been able to find any yet.

Thanks,
Kaz
maxwyss
Registered: Jul 25 2006
Posts: 255
Preview.app is a nice PDF viewer, but it is rather limited. In particular, it does not properly work with form fields, and in no way with smart forms. Simply, because it does not contain the Acrobat JavaScript engine.

Smart documents (we are talking about here) require a PDF viewer which can handle Acrobat JavaScript.

HTH

Max Wyss.


Kazdyn
Registered: May 1 2011
Posts: 2
Thanks Max. This will save me a lot of trouble. I appreciate your quick reply.

- Kaz