1

is there any way to have a fillable textfield which is breakable across two pages, i.e. not to be forced to one page only?

MWE:

\documentclass[11pt,a4paper]{letter}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{xparse,calc}
\usepackage{hyperref,stackengine}

\begin{document}
\item \belowbaseline[-\ht\strutbox]{%
  \TextField[width=18cm,height=1240pt, charsize=12pt,bordercolor=1 1 1,multiline=true,name=Partei1]{}}
\end{document}

Many thanks

3
  • 1
    Welcome to tex,sx, Jan 31 at 23:20
  • Unrelated, but I think, your MWE contains things that are not relevant for this question. Also, The \item command should be inside a list environment. Feb 1 at 8:46
  • Thank you @JasperHabicht. I admit not having tried the TextField alone, I will be more cutious next time. Thanks for the remark on the item, too! Feb 1 at 12:48

1 Answer 1

2

I don't think that multi-page form fields exist, but you can automatically place the focus in the second field if the first field is full (this idea is actually taken from the Acrobat JS API). For this, you'd need to deactivate scrolling for the relevant field via tha donotscroll option and add a small JavaScript to the keystroke option (I removed the bordercolor option to make the fields visible in the PDF):

\documentclass[11pt,a4paper]{letter}
\usepackage{hyperref}

\begin{document}
\begin{Form}
    \TextField[width=10cm, height=10cm, charsize=12pt, 
        multiline=true, name=Partei1a, keystroke={%
            if(event.fieldFull){ 
                this.getField("Partei1b").value = event.changeEx;
                this.getField("Partei1b").setFocus();
            }
        }, donotscroll]{}

    \newpage

    \TextField[width=10cm, height=10cm, charsize=12pt, 
        multiline=true, name=Partei1b, donotscroll]{}    
\end{Form}
\end{document}

If you enter text in the first field that exceeds the boundary of thi field, the cursor will automatically jump to the next field. But this automatism does not work when deleting text or pasting text. Also, I am not sure how to disable the annoying beep.

enter image description here

3
  • Thank you @JasperHabicht. That is a nice solution and it also introduces me to JavaScript. The PDF will have some information prefilled in the form itself, so I will experiment... Feb 1 at 12:53
  • Thank you @JasperHabicht. That is a nice solution and it also introduces me to JavaScript. The PDF will have some information prefilled in the form itself, so I will experiment... Feb 1 at 12:53
  • @StefanosRotas The solution is not bullet-proof, but I think in some way or the other, there should be a way to do this. Feb 1 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .