2

I'm using MikTex and Texmaker to create forms filled by clients. I just want to change the background color of the textfield, how to do it ?

\TextField[bordercolor=, backgroundcolor={red}, strokecolor={black},width=6.5cm,name=MyTextField]{}.

I'm new to Latex and searched many posts, couldn't find the right answer.

What are the name of the properties we can set for a textfield (like width=xxcm, bordercolor=none), could you take me in a right direction please ?

I would ike the backgorund color of my textfield in PDF either transparent or white.

Here is a MWE:

\documentclass[10pt,a4paper]{article}
\usepackage{hyperref}
\usepackage{xcolor}

\begin{document}
    \begin{Form}
        \TextField[name=Text, width=\linewidth, bordercolor={black}]{}
    \end{Form}
\end{document}

TextField before entering anything

TextField before entering anything

TextField after entering something and leaving the field

TextField after entering something and leaving the field

With $backgroundcolor={white}$ the background color of the field becomes white while the curor is in the field but when clicking somewhere else the color changes back.

0

The most important part is that you need a Form environment. With it it should work (but there is no strokecolor option:

\documentclass{article}
\usepackage{xcolor}
\usepackage{hyperref}

\begin{document}
\begin{Form}
\TextField[bordercolor=green, backgroundcolor={red},width=6.5cm,name=MyTextField]{}.
\end{Form}
\end{document}

enter image description here

2
  • It doesn't resolve the problem:(
    – Martund
    Feb 27 '21 at 1:41
  • This answer doesn't address the question.
    – R.U.
    Sep 22 '21 at 17:34
-1

Including a minimum working example (MWE) that shows the packages you're working with is always helpful. I assume you're working with the hyperref package based on the \TextField environment.

Finding LaTeX documentation

To quickly access documentation you can use the texdoc command to access the documdentation for various LaTeX packages (texdoc hyperref) or you can simply google your package name along with CTAN (e.g. hyperref ctan) to quickly find the corresponding package info (usually including docs) on the "CTAN Comprehensive TeX Archive Network"

What the hyperref docs say

pp. 36-37 of the hyperref PDF docs list all the parameters you can set for forms environments like \TextField.

2
  • This answer does not address the main question.
    – R.U.
    Sep 22 '21 at 17:35
  • Teach a man to fish...
    – Paul M.
    Sep 23 '21 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.