PDF-Formulare mit dem hyperref Paket erstellen

Hier ein einfaches Beispiel, wie man PDF-Formulare mit dem hyperref Paket erstellen kann.

\documentclass{article}
 
% Load hyperref with form support
\usepackage{hyperref}
 
\hypersetup{
  pdfauthor={Your Name},
  pdftitle={Sample Fillable PDF Form},
  pdfcreator={LaTeX with hyperref}
}
 
\begin{document}
 
\section*{Beispielformular}
 
Bitte ausfüllen!
 
\vspace{1em}
 
\noindent
\textbf{Name:}\\[0.5em]
\TextField[
  name=name,
  width=0.8\linewidth,
  bordercolor={0 0 0}
]{}
 
\vspace{1em}
 
\noindent
\textbf{E-Mail:}\\[0.5em]
\TextField[
  name=email,
  width=0.8\linewidth,
  bordercolor={0 0 0}
]{}
 
\vspace{1em}
 
\noindent
\textbf{Alter:}\\[0.5em]
\TextField[
  name=age,
  width=4cm]{}
 
\vspace{1em}
 
\noindent
\textbf{Lieblingsfrucht:}\\[0.5em]
\ChoiceMenu[
  name=gender,
  width=4cm,
  combo
]{Wählen einen Eintrag: }{Apfel,Birne,Kirsche}
 
\vspace{1em}
 
\noindent
\textbf{Newletter abonnieren?}\\[0.5em]
\CheckBox[name=subscribe]{} Ja
 
\vspace{1.5em}
 
\noindent
\textbf{Anmerkungen:}\\[0.5em]
\TextField[
  name=comments,
  width=\linewidth,
  height=3cm,
  multiline=true
]{}
 
\vspace{1.5em}
 
\noindent\PushButton[
  name=print,
  onclick={this.print({bUI:true,bSilent:false,bShrinkToFit:true});},
  bordercolor={0 0 0},
  width=4cm,
  height=1cm
]{Print Form}
 
\end{document}