Assume you have the following form in PDF ouput/equivalent in Fig. 1. I am thinking how to design the LaTeX form well enough for good data extraction (and eventually seeding into PostgreSQL database). You want to extract the following pieces of data in the form:
- Question 1 answer
- Question 2 answer
- Summary result
Code to generate the PDF file
% https://tex.stackexchange.com/a/384801/13173
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\begin{enumerate}
\item \ChoiceMenu[name=football,radio,default=0]{Do you play football?}{Much (2)=2,Little (1)=1,Not at all (0)=0}
\item \ChoiceMenu[name=ice-hockey,radio,default=0]{Do you play ice-hockey?}{Much (2)=2,Little (1)=1,Not at all (0)=0}
\end{enumerate}
\TextField[readonly=true,value=0,calculate={event.value=this.getField("football").value+this.getField("ice-hockey").value;}]{Summary score:}
\end{Form}
\end{document}
Fig. 1 Output
Testing accsupp [rejected because cannot take user input] (Steven)
Code which is not good example because it has integrated values and is not taking values from the user;
\documentclass{beamer}
\usepackage[english]{babel}
\usetheme{Berkeley}
\usepackage{accsupp} % https://ctan.org/pkg/accsupp
\begin{document}
\begin{frame}
\frametitle{Field}
\section{Field 2}
\begin{equation}
\BeginAccSupp{
method=pdfstringdef,
unicode,
ActualText={%
a\texttwosuperior +b\texttwosuperior
=c\texttwosuperior
}
}
a^2 + b^2 = c^2
\EndAccSupp{}
\end{equation}
\end{frame}
\end{document}
Output in Fig. 2 where I do not really see the point of this package with user inputs, since it is not asking them in the form.
Fig. 2 Output of too simple basic example of accsupp
OS: Debian 9
TeXLive: 2017


accsupppackage – Steven B. Segletes Aug 10 '17 at 18:30accsuppand you could get a feel for how it is used. – Steven B. Segletes Aug 11 '17 at 09:59accsuppcan take values from the PDF user, but only at LaTeX compile time. – Steven B. Segletes Aug 15 '17 at 20:18