summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex')
-rw-r--r--Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex259
1 files changed, 259 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex b/Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex
new file mode 100644
index 00000000000..4f26e5933e0
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pdf-forms-tutorial-en/examples/ex0101.tex
@@ -0,0 +1,259 @@
+\documentclass[ngerman,a4paper]{scrartcl}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{mathptmx}
+\usepackage[scaled=.92]{helvet}
+\usepackage{courier}
+\renewcommand*{\familydefault}{phv}
+\usepackage[left=25mm,top=25mm,bottom=10mm,right=10mm]{geometry}
+\usepackage{fancyhdr}
+\lhead{ABC, Inc.}\chead{}\rhead{XYZ Dept.}
+\lfoot{}\cfoot{}\rfoot{}
+\pagestyle{fancy}
+\usepackage{graphicx}
+\usepackage{color}
+\usepackage[
+ pdftex,a4paper=true,colorlinks=true,
+ pdftitle={Software installation request},pdfsubject={Software},
+ pdfauthor={ich},
+ pdfpagemode=UseNone,pdfstartview=FitH,
+ pagebackref,pdfhighlight={/N}
+]{hyperref}
+\usepackage[pdftex]{insdljs}
+\immediate\pdfobj {
+<<
+ /WP << /S /JavaScript /JS (willPrint();) >>
+ /DP << /S /JavaScript /JS (didPrint();) >>
+>>
+}
+\pdfcatalog{/AA \the\pdflastobj\space 0 R}
+\begin{insDLJS}[exaaba]{exaaba}{Document Level JavaScript}
+
+// indicate that the function was not yet run
+var done = 0;
+
+function colorsPrinting()
+{
+ this.getField("vorname").fillColor = color.white;
+ this.getField("vorname").strokeColor = color.black;
+ this.getField("vorname").textFont = font.Helv;
+ this.getField("name").fillColor = color.white;
+ this.getField("name").strokeColor = color.black;
+ this.getField("name").textFont = font.Helv;
+ this.getField("inventory").fillColor = color.white;
+ this.getField("inventory").strokeColor = color.black;
+ this.getField("inventory").textFont = font.Helv;
+ this.getField("sw01").fillColor = color.white;
+ this.getField("sw01").strokeColor = color.black;
+ this.getField("sw01").textFont = font.Helv;
+ this.getField("sw02").fillColor = color.white;
+ this.getField("sw02").strokeColor = color.black;
+ this.getField("sw02").textFont = font.Helv;
+ this.getField("sw03").fillColor = color.white;
+ this.getField("sw03").strokeColor = color.black;
+ this.getField("sw03").textFont = font.Helv;
+ this.getField("sw04").fillColor = color.white;
+ this.getField("sw04").strokeColor = color.black;
+ this.getField("sw04").textFont = font.Helv;
+ this.getField("sw05").fillColor = color.white;
+ this.getField("sw05").strokeColor = color.black;
+ this.getField("sw05").textFont = font.Helv;
+ this.getField("sw06").fillColor = color.white;
+ this.getField("sw06").strokeColor = color.black;
+ this.getField("sw06").textFont = font.Helv;
+ this.getField("sw07").fillColor = color.white;
+ this.getField("sw07").strokeColor = color.black;
+ this.getField("sw07").textFont = font.Helv;
+ this.getField("sw08").fillColor = color.white;
+ this.getField("sw08").strokeColor = color.black;
+ this.getField("sw08").textFont = font.Helv;
+ this.getField("sw09").fillColor = color.white;
+ this.getField("sw09").strokeColor = color.black;
+ this.getField("sw09").textFont = font.Helv;
+ this.getField("sw10").fillColor = color.white;
+ this.getField("sw10").strokeColor = color.black;
+ this.getField("sw10").textFont = font.Helv;
+}
+
+function colorsScreen()
+{
+
+ var newcolor = [ "RGB", 0.65, 0.79, 0.94];
+ this.getField("vorname").fillColor = newcolor;
+ this.getField("vorname").strokeColor = newcolor;
+ this.getField("vorname").textFont = font.HelvB;
+ this.getField("name").fillColor = newcolor;
+ this.getField("name").strokeColor = newcolor;
+ this.getField("name").textFont = font.HelvB;
+ this.getField("inventory").fillColor = newcolor;
+ this.getField("inventory").strokeColor = newcolor;
+ this.getField("inventory").textFont = font.HelvB;
+ this.getField("sw01").fillColor = newcolor;
+ this.getField("sw01").strokeColor = newcolor;
+ this.getField("sw01").textFont = font.HelvB;
+ this.getField("sw02").fillColor = newcolor;
+ this.getField("sw02").strokeColor = newcolor;
+ this.getField("sw02").textFont = font.HelvB;
+ this.getField("sw03").fillColor = newcolor;
+ this.getField("sw03").strokeColor = newcolor;
+ this.getField("sw03").textFont = font.HelvB;
+ this.getField("sw04").fillColor = newcolor;
+ this.getField("sw04").strokeColor = newcolor;
+ this.getField("sw04").textFont = font.HelvB;
+ this.getField("sw05").fillColor = newcolor;
+ this.getField("sw05").strokeColor = newcolor;
+ this.getField("sw05").textFont = font.HelvB;
+ this.getField("sw06").fillColor = newcolor;
+ this.getField("sw06").strokeColor = newcolor;
+ this.getField("sw06").textFont = font.HelvB;
+ this.getField("sw07").fillColor = newcolor;
+ this.getField("sw07").strokeColor = newcolor;
+ this.getField("sw07").textFont = font.HelvB;
+ this.getField("sw08").fillColor = newcolor;
+ this.getField("sw08").strokeColor = newcolor;
+ this.getField("sw08").textFont = font.HelvB;
+ this.getField("sw09").fillColor = newcolor;
+ this.getField("sw09").strokeColor = newcolor;
+ this.getField("sw09").textFont = font.HelvB;
+ this.getField("sw10").fillColor = newcolor;
+ this.getField("sw10").strokeColor = newcolor;
+ this.getField("sw10").textFont = font.HelvB;
+}
+
+function willPrint()
+{
+ this.delay = true;
+ colorsPrinting();
+ this.delay = false;
+}
+
+function didPrint()
+{
+ this.delay = true;
+ colorsScreen();
+ this.delay = false;
+}
+
+var softwareAuswahl = [
+ [ "", ""],
+ [ "Operating system", "os" ],
+ [ "Text processing", "tp" ],
+ [ "Spreadsheet calculation", "sc" ],
+ [ "Präsentationsprogramm", "pp" ],
+ [ "E-mail client", "mc" ],
+ [ "Web browser", "wb" ],
+ [ "Mathematics software", "ms" ],
+ [ "PDF viewer", "pv" ]
+];
+
+// function to run when opening the document
+function myFirstJavaScriptFunction()
+{
+ if(!done) {
+ done = 1;
+ this.delay = true;
+ colorsScreen();
+ this.getField("sw01").setItems(softwareAuswahl);
+ this.getField("sw01").currentValueIndices = 0;
+ this.getField("sw01").editable = true;
+ this.getField("sw02").setItems(softwareAuswahl);
+ this.getField("sw02").currentValueIndices = 0;
+ this.getField("sw02").editable = true;
+ this.getField("sw03").setItems(softwareAuswahl);
+ this.getField("sw03").currentValueIndices = 0;
+ this.getField("sw03").editable = true;
+ this.getField("sw04").setItems(softwareAuswahl);
+ this.getField("sw04").currentValueIndices = 0;
+ this.getField("sw04").editable = true;
+ this.getField("sw05").setItems(softwareAuswahl);
+ this.getField("sw05").currentValueIndices = 0;
+ this.getField("sw05").editable = true;
+ this.getField("sw06").setItems(softwareAuswahl);
+ this.getField("sw06").currentValueIndices = 0;
+ this.getField("sw06").editable = true;
+ this.getField("sw07").setItems(softwareAuswahl);
+ this.getField("sw07").currentValueIndices = 0;
+ this.getField("sw07").editable = true;
+ this.getField("sw08").setItems(softwareAuswahl);
+ this.getField("sw08").currentValueIndices = 0;
+ this.getField("sw08").editable = true;
+ this.getField("sw09").setItems(softwareAuswahl);
+ this.getField("sw09").currentValueIndices = 0;
+ this.getField("sw09").editable = true;
+ this.getField("sw10").setItems(softwareAuswahl);
+ this.getField("sw10").currentValueIndices = 0;
+ this.getField("sw10").editable = true;
+ this.getField("vorname").setFocus();
+ this.delay = false;
+ }
+}
+\end{insDLJS}
+\OpenAction{/S /JavaScript /JS (myFirstJavaScriptFunction();)}
+\newcommand{\textforlabel}[2]{%
+\TextField[name={#1},value={#2},width=9em,align=2,%
+bordercolor={1 1 1},readonly=true]{}%
+}
+\begin{document}
+\section*{Request for software licenses and installation}
+\begin{Form}
+\begin{tabular}{|rr|}
+\hline
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|c|}{\textbf{Systems owner}}\\
+&\\*[-0.9em]\textforlabel{l01}{First name:}&\TextField[%
+name=vorname,width=20em,bordercolor={0.65 0.79 0.94}]{}\\
+&\\*[-0.9em]\textforlabel{l02}{Name:}&\TextField[%
+name=name,width=20em,bordercolor={0.65 0.79 0.94}]{}\\
+&\\*[-0.9em]\hline
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|c|}{\textbf{PC}}\\
+&\\*[-0.9em]\textforlabel{l03}{inventory number:}%
+&\TextField[name=inventory,width=20em,%
+bordercolor={0.65 0.79 0.94}]{}\\
+&\\*[-0.9em]\hline
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|c|}{\textbf{Software}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw01,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw02,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw03,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw04,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw05,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw06,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw07,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw08,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw09,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{}\\*[-0.9em]
+\multicolumn{2}{|r|}{\ChoiceMenu[name=sw10,width=30em,%
+popdown=true,combo=true,value={},%
+bordercolor={0.65 0.79 0.94}]{}{}}\\
+\multicolumn{2}{|c|}{~}\\*\hline
+\end{tabular}
+\end{Form}
+\end{document}