“The fields in the form you created for me are not lined up with the lines and check boxes.”
“I have a script that is supposed to change the fill color of a text field to yellow when it is empty, and transparent when a value is entered. It works but you can only see the color when you click in the field. As soon as you exit the field the fill color changes back to light blue.”
“My fields are all blue (or purple) but the color does not show up when I print my form.”
The quotes above are all related to the same “issue”. Issue is in quotes because it's really an issue. It's more of a blind spot.
When “Misalignment” of Fields Is Highlighted
When text fields are added to a PDF, the user-entered text is centered vertically in the text field with space above and below the text. The text does not touch the upper and lower frame of the text field. When adding text fields to PDFs that have lines where the text should go, adding the text field so the bottom of the frame is on the line will cause the text will be too high.
To fix this the bottom of the text field needs to go below the line.
When adding check box fields that have check marks to squares on the PDF, if you match the size of the check boxes to the squares, the check marks will be very small.
I prefer a larger check mark and I’m not concerned if the tale goes outside the box, like happens when someone fills out a form like this with a pen.
Or, a larger check mark that almost touches the edges of the box.
To fix the check box sizing issue, create check boxes that are larger than the squares on the PDF and align them accordingly.
I've been doing this so long I can create the fields and line them up without exiting field editing mode to check the results. This ties into the first quote at the beginning of this post and all three tie into the subject.
Field Highlighting
Adobe PDF viewers are equipped with a field highlighting feature that can be turned on or off. The default color is a light blue color but it can be set to any color. Older versions of Adobe had a thick purple bar across the top of the page whenever a form was open, with a "Highlight Fields" message. Field highlighting could be switched on or off by clicking the bar and it was very obvious. It is not so obvious now. The default seems to be "on" with no obvious way to turn it off.
Some users like it on so they can "see where the fields they can type in are". I prefer it off most of the time because I don’t like the look, it hides field colors (see the second quote at the beginning of this post), and it distorts how the pages will be printed. In fact, you won’t see the highlighted fields in print preview.
Some users have no idea this feature even exists because it has always been on so they don't know any better.
On/Off
Field highlighting can be turned on by setting the app.runtimeHighlight property to true and off by setting the property to false.
//Run the following scripts in the console:
app.runtimeHighlight=true; //Field Highlighting on
app.runtimeHighlight=false; //Field Highlighting off
Notice this is an app (application) property, not a document property. That means turning it on or off does so for all forms, not just the current form. It actually changes the setting, application wide. To change it manually without using a script, simply press Ctrl + k to open the preferences and select the forms category on the left. Then check or uncheck the Show border color for fields box. You can also change the highlight color here. Before doing so I suggest you record the original color in the color picker in case you ever want to return to the default color.
When form creators have scripts that change the fill color of form fields depending on certain conditions, and they realize the fill colors can't be seen without the field having the focus when highlighting is turned on, they often ask how they can force highlighting off. It's easy to do but not recommended. All you need to do is create a document level script that sets app.runtimeHighlight to false.
It's surprising that you can change an application setting with a script that is not run from a privileged context. That's why it's not recommended. Since a lot of users don't know they can turn highlighting on or off, if you do it for them without warning, you'll probably confuse them and they'll think there's something wrong with the application.
Make A Highlight Toggle Switch
If you miss the Highlight Fields toolbar button you can create your own by making a custom toolbar button that runs the following script:
if(app.runtimeHighlight)
{app.runtimeHighlight=false}
else
{app.runtimeHighlight=true}
Creating the icons for custom toolbar buttons is not easy. Fortunately, I created a tool that does it for you.