# Latex forms: Transfer textfield border into line

How could I transfer a textfield border into a line to write on in case of someone files the printed version of the pdf form?

I'm working with underline and raiseboxes at the moment, but that crushes my layout at some points. So it would be great to use the border of \TextField to create a line.

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\underline{\raisebox{0.3em}{\TextField[width=7.cm,bordercolor=]{\textbf{Description:}}
\end{Form}
\end{document}


Without the \raisebox, the line is overlapped by the invisible \textfield[bordercolor=]. At most places, this works fince, although underlining the label looks weird. But when formating multiple of those in minipages etc., the layout gets out of place, because of the different line heights. Minimising the TextField does not work either. It takes either the full height or becomes a thin line.

So I'd like to alternate the border itself, to stay within normal line height and create a \textfield with just a line on the bottom in print version.

To use a line as border of a TextField, you can use the option borderstyle=U. You might also want to change the bordercolor to black:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\TextField[width=7.cm,borderstyle=U,bordercolor={0 0 0}]{\textbf{Description:}}
\end{Form}
\end{document}


This will change the border not only when printing the document, but also when it is displayed on screen. This is hard to avoid and in most cases a good thing. I always prefer for documents to look on screen as similar as possible as the printed version.

• Unfortunately, I just discovered, that the Adobe Reader doesn't display such a field at all. It's neither visible nor can I click into it. Evince (Linux) does. – MPW Oct 11 '18 at 10:08
• I tested it with Adobe Acrobat Pro DC (2015) and it worked without problems. Have you used the code from the answer or are there other packages that might interfere? – Marcel Krüger Oct 11 '18 at 10:16
• Damn, you're quick. I opened a new question with a minimal example you could test maybe: tex.stackexchange.com/questions/454740/… – MPW Oct 11 '18 at 10:19