1

I want to make a PDF form with various text fields.

I want to take the input from one textfield (where a number is typed in) and sustract it from another number. In the PDF, the substracted number should change based on the input from the textfield.

Is that possible? I am using \newcounter \setcounter and \addtocounter for the calculation, however I think the output from the textfield is not compatible to that. I don't know how to read the value from the textfield. Declaring a variable with \def only copies the entire textfield, how do I only get the value in the textfield? (The code output has to be opened in for example adobe acrobat reader to work)

\documentclass[a4paper,12pt,listof=leveldown]{scrreprt}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\begin{document}

\newcounter{first} \setcounter{first}{100} \newcounter{second} \setcounter{second}{20} % for the 20 i have to get some value of the textbox \addtocounter{first}{-\value{second}}\the\value{first} \vspace{1cm}

\begin{Form} \TextField[name=123,width=3cm,default=22,maxlen=2]{Input value:} \def\testvalue{\value{\TextField[name=123,readonly=true,width=3cm]{}}} %define the variable

\vspace{1cm} \testvalue %this does change when a different value is typed in above \end{Form} \end{document}

0 Answers0