3

I am wrinting a LaTeX document and I'd like it to be editable in Acrobat. I'm using Textfield provided by eforms.

This document is a longtable with a description and two cells the user needs to fill with text. I have about 300 lines and I can't imagine I need to create a name for each texffield I have (line * number of cells).

If I let the name empty, or if the name is the same for 2 textfields, then Acrobat Reader bugs so I wanted to concatenate eg rownumber and columnumber but I don't know how to retrieve the last one.

Is there any way to do it ?

Here is a MWE :

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage[pdftex]{eforms}


\begin{document}
  \section{}

  \begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
    \hline 
    \sc text here & \sc form1 & \sc form2 \\
    \hline
    \endhead

     text here & \TextField[{maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm,name=}]{} & \TextField[{maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm,name=}]{} \\
    \hline

   \end{longtable}
\end{document}
3

enter image description here

Please check if this helps. Here the roman numerals are used to name the fields (not actually checked for 300 lines).

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage[pdftex]{eforms}

\makeatletter
\newcount\fldn@me\fldn@me=1
%
\def\TextFieldX{%
\xdef\textFldName{name=\romannumeral\fldn@me}
\expandafter\TextField\expandafter[\expandafter{\textFldName,maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm}]{}%
\global\advance\fldn@me1
}
\makeatother

\begin{document}
  \section{Section A}
  \begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
    \hline 
    \sc text here & \sc form1 & \sc form2 \\
    \hline
    \endhead
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
    \hline
   \end{longtable}

  \section{Section B}
  \begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
    \hline 
    \sc text here & \sc form1 & \sc form2 \\
    \hline
    \endhead
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
      text here & \TextFieldX  & \TextFieldX \\
    \hline
   \end{longtable}

\end{document}
  • Of course this helps ! I wouldn't have thought about roman numeral. Very smart ! It really does the trick, thanks. – Hazelnut Oct 19 '13 at 20:52

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.