summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pdf-forms-tutorial-de/examples/ex0101.tex
blob: 52004303d4b02f8cac01a5151aac166efaa61fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
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{Firma ABC}\chead{}\rhead{Abteilung XYZ}
\lfoot{}\cfoot{}\rfoot{}
\pagestyle{fancy}
\usepackage{graphicx}
\usepackage{color}
\usepackage[
  pdftex,a4paper=true,colorlinks=true,
  pdftitle={Formular für Software},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}{JavaScript auf Document Level}

// 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 = [
  [ "", ""],
  [ "Betriebssystem", "os" ],
  [ "Textverarbeitung", "tp" ],
  [ "Tabellenkalkulation", "sc" ],
  [ "Präsentationsprogramm", "pp" ],
  [ "E-Mail-Client", "mc" ],
  [ "Web browser", "wb" ],
  [ "Mathematik-Software", "ms" ],
  [ "PDF-Anzeigeprogramm", "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*{Anforderung von Software-Lizenzen und -installationen}
\begin{Form}
\begin{tabular}{|rr|}
\hline
\multicolumn{2}{|c|}{}\\*[-0.9em]
\multicolumn{2}{|c|}{\textbf{Systemverantwortlicher}}\\
&\\*[-0.9em]\textforlabel{l01}{Vorname:}&\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}{Inventarnummer:}%
&\TextField[name=inventory,width=20em,%
bordercolor={0.65 0.79 0.94}]{}\\
&\\*[-0.9em]\hline
\multicolumn{2}{|c|}{}\\*[-0.9em]
\multicolumn{2}{|c|}{\textbf{Ben\"{o}tigte 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}