7

I am using LaTeX to make a fillable PDF file.

I use the \TextField command in the hyperref package to get the fillable field in the PDF file.

In some places, I want to have a field which has a limited number of characters for input, e.g. the phone number or card number.

How could I realize this effect? I looked up the texdoc for hyperref package but failed to find any information for this effect.

Would anyone please give me some idea?

10

hyperref provides the key-value maxlen that limits the number of characters in a text field:

enter image description here

\documentclass{article}
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\begin{document}
\begin{Form}
\TextField[name=phonenumber,value=xxxyyyzzzz,maxlen=10]{Phone:}
\end{Form}
\end{document}

This is discussed in the hyperref manual under section 6.2 Forms optional parameters.

  • Thank you very much, Werner. Your answer has definitely solved my problem. I am sorry for my inattention when reading the manual, though I had gone through the option arguments in §6.2. – qewr Feb 27 '13 at 8:28
  • @HanzhiDiao: hyperref has many options that are not readily documented. If this answered your question, consider accepting it as such. See How do you accept an answer? – Werner Feb 27 '13 at 8:31
  • I have made the accepting. Sorry for the delayed operation. It is my first post here. – qewr Feb 27 '13 at 10: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.