pdf-formulare mit pdflatex, hyperref und...

66
PDF-Formulare mit pdflatex, hyperref und insdljs Dirk Krause 7. Februar 2008 1

Upload: others

Post on 16-Mar-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

PDF-Formulare mit pdflatex, hyperrefund insdljs

Dirk Krause

7. Februar 2008

1

Inhaltsverzeichnis1 Einführung 4

1.1 Copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Zweck dieses Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2 Formular-Support in hyperref 5

3 Vorbetrachtungen 63.1 Präambel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1.1 Dokumentenklasse . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.1.2 Schriftarten . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.1.3 Seitenlayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.1.4 Graphiken und Farben . . . . . . . . . . . . . . . . . . . . . . . . . 73.1.5 hyperref-Paket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2 Eigenschaften der Formularelemente . . . . . . . . . . . . . . . . . . . . . . 8

4 Das erste Formular 94.1 Aufgabenstellung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.2 Erster Anlauf: ex0001 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.3 Anordnung in Tabelle: ex0002 . . . . . . . . . . . . . . . . . . . . . . . . . 114.4 Zwischenräume und Feldbreiten: ex0003 . . . . . . . . . . . . . . . . . . . . 134.5 Gleiche Texthöhe: ex0004 . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.6 Farbe: ex0005 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.7 JavaScript: ex0006 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.8 Dokument-Ereignisse: ex0008 und ex0009 . . . . . . . . . . . . . . . . . . . 244.9 Formularfeld-Ereignisse: ex0010 . . . . . . . . . . . . . . . . . . . . . . . . 324.10 Editierbare Auswahlliste: ex0011 . . . . . . . . . . . . . . . . . . . . . . . . 374.11 Online-Hilfe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.11.1 Übersicht . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.11.2 PDF-Annotationen . . . . . . . . . . . . . . . . . . . . . . . . . . . 434.11.3 Tooltips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5 Ein weiteres Formular 445.1 Aufgabenstellung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445.2 Auswahllisten mit JavaScript initialisieren: ex0101 . . . . . . . . . . . . . . 44

6 Formular Nummer drei: Interaktive Anwendung 516.1 Aufgabenstellung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516.2 Reaktion auf Button: ex0201 . . . . . . . . . . . . . . . . . . . . . . . . . . 51

7 Formular Nummer vier: inputenc und insdljs 55

A Historie 58

2

B GNU Free Documentation License 59B.1 APPLICABILITY AND DEFINITIONS . . . . . . . . . . . . . . . . . . . . 59B.2 VERBATIM COPYING . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61B.3 COPYING IN QUANTITY . . . . . . . . . . . . . . . . . . . . . . . . . . . 61B.4 MODIFICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61B.5 COMBINING DOCUMENTS . . . . . . . . . . . . . . . . . . . . . . . . . 63B.6 COLLECTIONS OF DOCUMENTS . . . . . . . . . . . . . . . . . . . . . . 64B.7 AGGREGATION WITH INDEPENDENT WORKS . . . . . . . . . . . . . 64B.8 TRANSLATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64B.9 TERMINATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64B.10 FUTURE REVISIONS OF THIS LICENSE . . . . . . . . . . . . . . . . . . 65

3

1 Einführung

1.1 CopyrightCopyright (c) 2007 Dirk Krause

Permission is granted to copy, distribute and/or modify this document under the terms of theGNU Free Documentation License, Version 1.2 or any later version published by the FreeSoftware Foundation; with no Invariant Sections, with no Front-Cover Texts, and with noBack-Cover Texts.A copy of the license is included in the appendix in a section named „GNU Free DocumentationLicense“.

1.2 Zweck dieses TutorialsDieses Tutorial gibt eine Einführung, wie man mit pdfLATEX, hyperref und insdljs PDF-Formulare erstellen kann. Der Schwerpunkt liegt auf Formularen, die am Rechner ausgefülltund anschließend ausgedruckt werden sollen.

Folgende Voraussetzungen müssen erfüllt sein, damit Sie die Schritte dieses Tutorials nach-vollziehen können:

• Sie benötigen eine LATEX-Distribution, die das Kommando „pdflatex“ enthält.

• Das hyperref-Package muss installiert sein.

• Das insdljs-Package muss installiert sein. Hierbei handelt es sich um einen Teil desAcroTex Education Bundles, das unter http://www.acrotex.net zu finden ist.Dieses Paket ermöglicht es, Document Level JavaScript einzufügen.

Folgende Dokumentationen sollten verfügbar sein:

• das Manual zum hyperref-Package.[RO04],

• die Guides, Spezifikationen und Referenzen zu Acrobat JavaScript in PDF-Dateien[Sup03],[ADS05a],[ADS05b] und

• die Referenz zum PDF-Dateiformat[ASI01].

Die ersten Dokumentationen werden unbedingt benötigt, die PDF-Referenz eher seltener.In diesem Tutorial werden drei Beispiel-Formulare vorgestellt, das erste Beispiel wird

schrittweise entwickelt. Die Endfassungen der Formulare befinden sich in den Dateien„ex0011.tex“, „ex0101.tex“ und „ex0201.tex“.

4

2 Formular-Support in hyperrefHinweis: Die in diesem Abschnitt dargestellten Informationen wurden dem Handbuch manu-al.pdf der hyperref-Dokumentation ([RO04]) entnommen. Dort werden die Form-Umgebung,die Formularfeld-Makros und deren Parameter wesentlich detaillierter dargestellt als hier.

Das hyperref-Paket bietet Umgebungen und Makros für den Formular-Entwurf an. Die For-mularfelder müssen in einer Form-Umgebung platziert werden, pro Datei darf eine Form-Umgebung verwendet werden.Folgende Makros erstellen Formularfelder:

• \TextField[Parameter]{Text}erzeugt ein Textfeld.

• \CheckBox[Parameter]{Text}erzeugt eine Checkbox.

• \ChoiceMenu[Parameter]{Text}{Auswahl-Optionen}erzeugt eine Auswahlliste.

• \PushButton[Parameter]{Text}erzeugt einen Button.

• \Submit[Parameter]{Text}erzeugt einen Submit-Button. Das Drücken eines Submit-Buttons bewirkt, dass die indas Formular eingegebenen Daten an die URL gesendet werden, die als action-Parameterder Form-Umgebung angegeben wurde.

• \Reset[Parameter]{Text}erzeugt einen Reset-Button.

5

3 Vorbetrachtungen

3.1 Präambel3.1.1 Dokumentenklasse

Für Formulare kann die gewohnte Dokumentenklasse – z. B. scrartcl oder article – verwendetwerden.

3.1.2 Schriftarten

Der PDF-Standard gibt vor, welche Schriftarten jedes PDF-Anzeigeprogramm darstellen kön-nen muss, auch wenn der entsprechende Font nicht in der PDF-Datei eingebettet ist. DieseSchriften können für Formularfelder auch per JavaScript eingestellt werden. Da wir die Schrift-arten mit JavaScript-Befehlen ändern wollen, verwenden wir von vornherein diese Schriften.Im Wesentlichen handelt es sich um die Schriftfamilien Times, Helvetica und Courier.Die Packages für die Schriftfamilien als Type-1-Fonts werden mit

1 \ u s e p a c k a g e { mathptmx }2 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }3 \ u s e p a c k a g e { c o u r i e r }

geladen.Mit

1 \ u s e p a c k a g e [ T1 ] { f o n t e n c }

wird T1-Encoding anstelle des von LATEX standardmäßig benutzten OT1-Encodings benutzt.Mit

1 \ renewcommand * { \ f a m i l y d e f a u l t } { \ phv }

wird die Helvetica als Standardschrift eingestellt, da serifenlose Schriften auf dem Bildschirmmeist besser lesbar sind als Schriften mit Serifen.

3.1.3 Seitenlayout

Mit

1 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

werden die Ränder festgelegt. Formulare werden meist abgeheftet, der linke Seitenrand solltealso groß genug gewählt werden. Hier wurde auch ein relativ großer oberer Rand gewählt, umein Formular z. B. auf einem Klemmbrett befestigen zu können.Mit

1 \ u s e p a c k a g e { f a n c y h d r }2 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}3 \ l f o o t { } \ c f o o t { } \ r f o o t {}4 \ p a g e s t y l e { f a n c y }

werden die Kopf- und Fußzeilen gestaltet.

6

3.1.4 Graphiken und Farben

Mit

1 \ u s e p a c k a g e { g r a p h i c x }2 \ u s e p a c k a g e { c o l o r }

werden zwei weitere Packages eingebunden, die für die Verwendung von Graphiken (z. B. einLogo) und Farben benötigt werden.

3.1.5 hyperref-Paket

Das hyperref-Paket wird mit

1 \ u s e p a c k a g e [2 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,3 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } ,4 p d f s u b j e c t ={ Zugang } ,5 p d f a u t h o r ={ i c h } ,6 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH , p d f h i g h l i g h t ={ /N}7 ] { h y p e r r e f }

7

3.2 Eigenschaften der FormularelementeFür die Gestaltung der Formularelemente empfehle ich, entsprechend Tabelle 1 vorzugehen.

Tabelle 1: Gestaltung von Formularelementen

Umrandung Füllung SchriftBildschirm farbig farbig fett

Druck schwarz weiß normal

Bildschirm und Druck1 farbig weiß normal

Es wird davon ausgegangen, dass Formulare in größeren Mengen gedruckt werden. Beiausgedruckten Formularen ist in aller Regel die enthaltene Information wichtig, nicht so sehrdie Schönheit. Deshalb wird meist auf Schwarz-Weiß-Druckern gedruckt.

Beim Ausfüllen am Bildschirm sollten möglichst alle Formularfelder deutlich farbig mar-kiert sein, damit keines übersehen wird. Damit die Schrift gut lesbar ist und sich optisch deut-lich vom farbig gefüllten Hintergrund abhebt, wird eine fette Schrift eingesetzt.

Beim Ausdruck erscheint die Schrift schwarz auf weiß und muss daher nicht mehr fettsein. Dem Formular-Auswerter – der das ausgedruckte Formular vor sich hat – wird die Ar-beit erleichtert, wenn die eingetragenen Daten sich deutlich von den Formularbeschriftungenabheben. Hierzu dient die schwarze Umrandung.

Der Wechsel zwischen Bildschirmdarstellung und Druckdarstellung erfordert, dass Java-Script im PDF-Anzeigeprogramm erlaubt ist. Einige Nutzer verbieten dies aus Sicherheitsgrün-den, hier muss bei der Darstellung ein Kompromiss gefunden werden. Die farbige Umrandungmarkiert nach wie vor die Formularfelder, ohne farbige Füllung allerdings nicht so deutlich.Auch auf dem Ausdruck ist die Markierung weniger deutlich als mit JavaScript, da helle Far-ben in ein entsprechend helles Grau umgewandelt werden, wenn auf Schwarz-Weiß-Druckerngedruckt wird.

Die Markierungsfarbe sollte für alle Formularelemente gleich gewählt werden. Da schwar-zer Text auf farbig gefüllten Flächen erscheint, sollte eine möglichst helle Farbe gewähltwerden. Ich persönlich verwende häufig hellblau, die Wahl einer Farbe ist letztendlich Ge-schmackssache.

1JavaScript ist deaktiviert

8

4 Das erste Formular

4.1 AufgabenstellungEs soll ein Formular entworfen werden, mit dem Schlüssel für Mitarbeiter angefordert werden.Das Formular soll u. a. folgende Informationen enthalten:

• Vorname und Name

• Abteilung

• Zeitdauer (unbefristet bzw. befristet von . . . bis . . . ).

• die zu schließenden Türen.

Vorname und Name werden in Textfelder eingegeben. Die Abteilung wird aus einer Auswahl-liste ausgewählt, die Angabe befristet/unbefristet ebenso. Anfangs- und Endzeitraum werdenin Textfelder eingegeben. Die zu schließenden Türen werden mit Checkboxen ausgewählt.

4.2 Erster Anlauf: ex0001Datei ex0001.tex zeigt einen ersten Versuch zur Realisierung des Formulares.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,19 p d f a u t h o r ={ i c h } , pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ b e g i n { document }23 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }

9

24 \ b e g i n {Form}25 \ t e x t b f { M i t a r b e i t e r } \ \26 Vorname : \ T e x t F i e l d [ name=vorname ] { } \ \27 Name : \ T e x t F i e l d [ name=name ] { } \ \28 A b t e i l u n g : \ ChoiceMenu [ name= a b t ]{}{%29 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \30 \ t e x t b f { Z e i t d a u e r } \ \31 Z e i t r a u m : \ ChoiceMenu [ name= z e i t ]{}{%32 b e f r i s t e t =b , u n b e f r i s t e t =u } \ \33 von : \ T e x t F i e l d [ name=von ] { } \ \34 b i s : \ T e x t F i e l d [ name= b i s ] { } \ \35 \ t e x t b f {Zu s c h l i e " sende Türen } \ \36 H a u s t ü r : \ CheckBox [ name= h t ] { } \ \37 Etage 1 : \ CheckBox [ name=e1 ] { } \ \38 Etage 2 : \ CheckBox [ name=e2 ] { } \ \39 \ end {Form}40 \ end { document }

Nachdem die PDF-Datei ex0001 mit

1 p d f l a t e x ex0001 && p d f l a t e x ex0001

erstellt wurde, kann sie im PDF-Viewer geöffnet werden. Die gewünschte Funktionalität istzwar vorhanden, das Aussehen läßt – vorsichtig formuliert – zu wünschen übrig.

Am Quelltext kann aber bisher Folgendes nachvollzogen werden:

• Für jedes Formularelement wurde ein eindeutiger Name angegeben. Dies wird späterwichtig, um aus JavaScript-Funktionen heraus bestimmte Elementeeigenschaften zu än-dern.

• Für Auswahllisten (ChoiceMenu) wird als letztes Argument eine Werteliste angegeben.Die Einträge der Liste sind durch Kommata getrennt. Jeder Eintrag enthält links vomGleichheitszeichen den anzuzeigenden Text und rechts ein Kürzel. Dieses Kürzel istspäter wichtig, wenn mit JavaScript abgefragt wird, welcher Eintrag aktuell ausgewähltist.

10

4.3 Anordnung in Tabelle: ex0002Um die Darstellung in Tabellenform zu bringen, wird die tabular-Umgebung genutzt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,19 p d f a u t h o r ={ i c h } , pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ b e g i n { document }23 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }24 \ b e g i n {Form}25 \ b e g i n { t a b u l a r } { | r l | }26 \ h l i n e27 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \28 Vorname:&%29 \ T e x t F i e l d [ name=vorname ] { } \ \30 Name:&%31 \ T e x t F i e l d [ name=name ] { } \ \32 A b t e i l u n g :&%33 \ ChoiceMenu [ name= a b t ]{}{%34 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \35 \ h l i n e36 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \37 Z e i t r a u m:&%38 \ ChoiceMenu [ name= z e i t ]{}{%39 b e f r i s t e t =b , u n b e f r i s t e t =u } \ \40 von:&%41 \ T e x t F i e l d [ name=von ] { } \ \

11

42 b i s :&%43 \ T e x t F i e l d [ name= b i s ] { } \ \44 \ h l i n e45 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {Zu s c h l i e ß e n d e Türen } } \ \46 H a u s t ü r :&%47 \ CheckBox [ name=ht , w id th =1 .2em ] { } \ \48 Etage 1:&%49 \ CheckBox [ name=e1 , wid th =1 .2em ] { } \ \50 Etage 2:&%51 \ CheckBox [ name=e2 , wid th =1 .2em ] { } \ \52 \ h l i n e53 \ end { t a b u l a r }54 \ end {Form}55 \ end { document }

Kritikpunkte:

• Zwischen den Eingabefeldern existiert kein vertikaler Zwischenraum.

• Auch nach einer Auswahl zeigen die Auswahllisten alle Werte an. Im Normalfall sollhier nur ein Wert angezeigt werden.

• Auswahllisten und Textfelder haben unterschiedliche Längen.

12

4.4 Zwischenräume und Feldbreiten: ex0003Das Problem der vertikalen Zwischenräume wird mit

1 &&\\*[−0.9em ]

am Anfang jeder Zeile gelöst. Vor der letzten horizontalen Linie ist dies allerdings nicht mög-lich, hier wird eine komplette Leerzeile mit

1 &&\\*eingefügt.

Bei den Auswahllisten wird der Parameter „popdown=true“ gesetzt. Alle Elemen-te (mit Ausnahme der Checkboxen und der von/bis-Textfelder) erhalten den Parameter

„width=20em“.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,19 p d f a u t h o r ={ i c h } , pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ b e g i n { document }23 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }24 \ b e g i n {Form}25 \ b e g i n { t a b u l a r } { | r l | }26 \ h l i n e27 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \28 &\\*[ −0.9em ] Vorname:&%29 \ T e x t F i e l d [ name=vorname , wid th =20em ] { } \ \30 &\\*[ −0.9em ] Name:&%31 \ T e x t F i e l d [ name=name , wid th =20em ] { } \ \

13

32 &\\*[ −0.9em ] A b t e i l u n g :&%33 \ ChoiceMenu [ { } = {} , name= abt , w id th =20em , popdown= t r u e ]{}{%34 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \35 &\\*[ −0.9em ] \ h l i n e36 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \37 &\\*[ −0.9em ] Z e i t r a u m:&%38 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e ]{}{%39 b e f r i s t e t =b , u n b e f r i s t e t =u } \ \40 &\\*[ −0.9em ] von:&%41 \ T e x t F i e l d [ name=von , wid th =10em ] { } \ \42 &\\*[ −0.9em ] b i s :&%43 \ T e x t F i e l d [ name= b i s , w id th =10em ] { } \ \44 &\\*[ −0.9em ] \ h l i n e45 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {Zu s c h l i e ß e n d e Türen } } \ \46 &\\*[ −0.9em ] H a u s t ü r :&%47 \ CheckBox [ name=ht , w id th =1 .2em ] { } \ \48 &\\*[ −0.9em ] Etage 1:&%49 \ CheckBox [ name=e1 , wid th =1 .2em ] { } \ \50 &\\*[ −0.9em ] Etage 2:&%51 \ CheckBox [ name=e2 , wid th =1 .2em ] { } \ \52 &\\53 \ h l i n e54 \ end { t a b u l a r }55 \ end {Form}56 \ end { document }

Verbleibende Kritikpunkte:

• Die Beschriftungen befinden sich auf anderer Höhe als die vom Nutzer eingegebenenTexte.

14

4.5 Gleiche Texthöhe: ex0004Das Problem der unterschiedlichen Höhen resultiert aus der äußeren und inneren Umrandungder Formularelemente. Diese Umrandungen sind bei normalem Text nicht vorhanden.

Deshalb werden für die Beschriftungen ebenfalls Textfelder verwendet, diese sind allerdingsnicht editierbar und haben eine weiße Umrandung. Diese wird mit

1 b o r d e r c o l o r ={1 1 1}

eingestellt.Mit

1 a l i g n =2

wird der Text rechtsbündig eingestellt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,19 p d f a u t h o r ={ i c h } , pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ newcommand { \ t e x t f o r l a b e l }[2]{%23 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em,%24 a l i g n =2 , b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%25 }26 \ b e g i n { document }27 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }28 \ b e g i n {Form}29 \ b e g i n { t a b u l a r } { | r l | }30 \ h l i n e31 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \

15

32 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%33 \ T e x t F i e l d [ name=vorname , wid th =20em ] { } \ \34 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%35 \ T e x t F i e l d [ name=name , wid th =20em ] { } \ \36 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%37 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v]{}{%38 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \39 &\\*[ −0.9em ] \ h l i n e40 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \41 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%42 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u]{}{%43 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \44 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%45 \ T e x t F i e l d [ name=von , wid th =10em ] { } \ \46 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%47 \ T e x t F i e l d [ name= b i s , w id th =10em ] { } \ \48 &\\*[ −0.9em ] \ h l i n e49 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {Zu s c h l i e ß e n d e Türen } } \ \50 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ H a u s t ü r :}&%51 \ CheckBox [ name=ht , w id th =1 .2em ] { } \ \52 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%53 \ CheckBox [ name=e1 , wid th =1 .2em ] { } \ \54 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%55 \ CheckBox [ name=e2 , wid th =1 .2em ] { } \ \56 &\\57 \ h l i n e58 \ end { t a b u l a r }59 \ end {Form}60 \ end { document }

16

4.6 Farbe: ex0005Mit

1 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 }

wird für alle Formularelemente hellblau als Umrandungsfarbe eingestellt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,19 p d f a u t h o r ={ i c h } ,20 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,21 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}22 ] { h y p e r r e f }23 \ newcommand { \ t e x t f o r l a b e l }[2]{%24 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%25 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%26 }27 \ b e g i n { document }28 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }29 \ b e g i n {Form}30 \ b e g i n { t a b u l a r } { | r l | }31 \ h l i n e32 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \33 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%34 \ T e x t F i e l d [ name=vorname , wid th =20em,%35 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \36 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%37 \ T e x t F i e l d [ name=name , wid th =20em,%38 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \

17

39 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%40 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%41 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%42 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \43 &\\*[ −0.9em ] \ h l i n e44 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \45 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%46 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%47 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%48 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \49 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%50 \ T e x t F i e l d [ name=von , wid th =10em,%51 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \52 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%53 \ T e x t F i e l d [ name= b i s , w id th =10em,%54 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \55 &\\*[ −0.9em ] \ h l i n e56 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%57 \ t e x t b f {Zu s c h l i e ß e n d e Türen } } \ \58 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ H a u s t ü r :}&%59 \ CheckBox [ name=ht , w id th =1 .2em,%60 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \61 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%62 \ CheckBox [ name=e1 , wid th =1 .2em,%63 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \64 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%65 \ CheckBox [ name=e2 , wid th =1 .2em,%66 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \67 &\\68 \ h l i n e69 \ end { t a b u l a r }70 \ end {Form}71 \ end { document }

18

4.7 JavaScript: ex0006Um JavaScript auf Dokument-Ebene einzufügen, wird das Package insdljs benutzt, dabei mussder benutzte Ausgabetreiber angegeben werden.

1 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }

Der einzufügende JavaScript-Code wird in eine insDLJS-Umgebung geschrieben. Für das op-tionale und das erste geforderte Argument wird ein LATEX-Identifier benötigt (am besten einenString aus lauter Buchstaben verwenden, keine Zahlen). Das zweite geforderte Argument istein Kommentar.

1 \ b e g i n { insDLJS } [ e xa a aa ] { e xa a aa }{ J a v a S c r i p t a u f Document Leve l }2 / / . . . P l a c e Java s o u r c e code h e r e . . .3 \ end { insDLJS }

Der Identifier wird verwendet, um einen Dateinamen zu bilden („exaaaa.djs“), in dem derJavaScript-Code temporär gepackt abgespeichert wird.

Die Funktion, die beim Öffnen des Dokumentes – genauer gesagt beim Öffnen der erstenSeite – gestartet wird, wird mit dem OpenAction-Makro angegeben.

1 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }

Wie für PDF üblich, steht der String in Klammern. Der String enthält den auszuführendenBefehl, also den Funktionsnamen mit Klammern, möglichen Parametern und abschließendemSemikolon.

Die hier angegebene Funktion wird jedesmal aufgerufen, wenn die erste Seite geöffnet wird.Um die beim Öffnen des Dokumentes notwendigen Schritte nur einmal auszuführen, wird ineiner Variable gespeichert, ob die Funktion bereits aufgerufen wurde.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,

19

19 p d f a u t h o r ={ i c h } ,20 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,21 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}22 ] { h y p e r r e f }23 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }24 \ b e g i n { insDLJS } [ e xa a aa ] { e xa a aa }{ J a v a S c r i p t a u f Document Leve l }25

26 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run27 v a r done = 0 ;28

29 / / f u n c t i o n t o run when open ing t h e document30 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )31 {32 i f ( ! done ) {33 done = 1 ;34 app . a l e r t ( " Das Formula r wurde g e ö f f n e t . " ) ;35 }36 }37 \ end { insDLJS }38 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }39 \ newcommand { \ t e x t f o r l a b e l }[2]{%40 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%41 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%42 }43 \ b e g i n { document }44 \ s e c t i o n *{ Anforde rung e i n e s G r u p p e n s c h l ü s s e l s }45 \ b e g i n {Form}46 \ b e g i n { t a b u l a r } { | r l | }47 \ h l i n e48 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \49 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%50 \ T e x t F i e l d [ name=vorname , wid th =20em,%51 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \52 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%53 \ T e x t F i e l d [ name=name , wid th =20em,%54 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \55 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%56 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%57 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%58 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \59 &\\*[ −0.9em ] \ h l i n e60 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \61 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%62 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%

20

63 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%64 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \65 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%66 \ T e x t F i e l d [ name=von , wid th =10em,%67 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \68 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%69 \ T e x t F i e l d [ name= b i s , w id th =10em,%70 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \71 &\\*[ −0.9em ] \ h l i n e72 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {%73 Zu s c h l i e ß e n d e Türen } } \ \74 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ H a u s t ü r :}&%75 \ CheckBox [ name=ht , w id th =1 .2em,%76 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \77 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%78 \ CheckBox [ name=e1 , wid th =1 .2em,%79 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \80 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%81 \ CheckBox [ name=e2 , wid th =1 .2em,%82 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \83 &\\84 \ h l i n e85 \ end { t a b u l a r }86 \ end {Form}87 \ end { document }

Beim Öffnen der PDF-Datei ex0006.pdf erscheint eine Message-Box. In dieser ist das Zei-chen ö falsch dargestellt. Ursache hierfür ist die Verwendung des Packages inputenc mit derEinstellung latin1. Dies wandelt Umlaute und ß in LATEX-gerechte Folgen wie „"o“ um, konse-quenterweise auch für JavaScript.Es gibt zwei Möglichkeiten, dieses Problem zu lösen:

• Das Paket inputenc wird nicht verwendet. Alle Umlaute. . . im Text werden durch ihrejeweilige LATEX-Codierung ersetzt.Ein Beispiel hierfür wird im Listing am Ende dieses Abschnittes dargestellt.

• Im JavaScript-Code werden die Umlaute nicht direkt sondern als JavaScript-Unicode-Zeichen eingegeben. Dieses Verfahren wird in Abschnitt 7 auf Seite 55 dargestellt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }

21

7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ b e g i n { insDLJS } [ exaaab ] { exaaab }{ J a v a S c r i p t a u f Document Leve l }24

25 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run26 v a r done = 0 ;27

28 / / f u n c t i o n t o run when open ing t h e document29 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )30 {31 i f ( ! done ) {32 done = 1 ;33 app . a l e r t ( " Das Formula r wurde g e ö f f n e t . " ) ;34 }35 }36 \ end { insDLJS }37 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }38 \ newcommand { \ t e x t f o r l a b e l }[2]{%39 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%40 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%41 }42 \ b e g i n { document }43 \ s e c t i o n *{ Anforde rung e i n e s Gruppensch l \ " { u} s s e l s }44 \ b e g i n {Form}45 \ b e g i n { t a b u l a r } { | r l | }46 \ h l i n e47 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \48 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%49 \ T e x t F i e l d [ name=vorname , wid th =20em,%50 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \

22

51 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%52 \ T e x t F i e l d [ name=name , wid th =20em,%53 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \54 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%55 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%56 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%57 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \58 &\\*[ −0.9em ] \ h l i n e59 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \60 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%61 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%62 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%63 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \64 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%65 \ T e x t F i e l d [ name=von , wid th =10em,%66 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \67 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%68 \ T e x t F i e l d [ name= b i s , w id th =10em,%69 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \70 &\\*[ −0.9em ] \ h l i n e71 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%72 \ t e x t b f {Zu s c h l i e \ s s {} ende T \ " { u} r e n } } \ \73 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ Haus t \ " { u} r :}&%74 \ CheckBox [ name=ht , w id th =1 .2em,%75 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \76 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%77 \ CheckBox [ name=e1 , wid th =1 .2em,%78 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \79 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%80 \ CheckBox [ name=e2 , wid th =1 .2em,%81 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \82 &\\83 \ h l i n e84 \ end { t a b u l a r }85 \ end {Form}86 \ end { document }

23

4.8 Dokument-Ereignisse: ex0008 und ex0009Um auf Document-Events zu reagieren, muss dem PDF-Katalog ein /AA-Eintrag hinzugefügtwerden. Als Wert hat dieser Eintrag einen Verweis auf ein Dictionary, das für verschiedeneDocument-Events die Event-Handler definiert.Die Einträge in diesem Dictionary bestehen aus je einem Key, der ein Event repräsentiert undeinem Dictionary mit der Beschreibung für die auszuführende Aktion.Folgende Keys können auftreten:

Key Bedeutung/WP Das Dokument soll gedruckt werden.

/DP Das Dokument wurde gedruckt.

/WS Das Dokument soll gespeichert werden.

/DS Das Dokument wurde gespeichert.

/DC Das Dokument soll geschlossen werden.

Im Beispiel wird für das WillPrint-Event die Funktion willPrint(); aufgerufen und für dasDidPrint-Event die Funktion didPrint();.

1 \ immedia te \ p d f o b j {2 <<3 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>4 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>5 >>6 }7 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}

In ex0008.pdf wird vor und nach dem Drucken eine Message-Box angezeigt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,

24

18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ immedia te \ p d f o b j {24 <<25 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>26 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>27 >>28 }29 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}30 \ b e g i n { insDLJS } [ e xa a ac ] { e xa a ac }{ J a v a S c r i p t a u f Document Leve l }31

32 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run33 v a r done = 0 ;34

35 f u n c t i o n w i l l P r i n t ( )36 {37 app . a l e r t ( " G l e i c h wird g e d r u c k t . " ) ;38 }39

40 f u n c t i o n d i d P r i n t ( )41 {42 app . a l e r t ( " Es wurde g e d r u c k t . " ) ;43 }44

45 / / f u n c t i o n t o run when open ing t h e document46 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )47 {48 i f ( ! done ) {49 done = 1 ;50 app . a l e r t ( " Das Formula r wurde g e ö f f n e t . " ) ;51 }52 }53 \ end { insDLJS }54 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }55 \ newcommand { \ t e x t f o r l a b e l }[2]{%56 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%57 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%58 }59 \ b e g i n { document }60 \ s e c t i o n *{ Anforde rung e i n e s Gruppensch l \ " { u} s s e l s }61 \ b e g i n {Form}

25

62 \ b e g i n { t a b u l a r } { | r l | }63 \ h l i n e64 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \65 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%66 \ T e x t F i e l d [ name=vorname , wid th =20em,%67 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \68 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%69 \ T e x t F i e l d [ name=name , wid th =20em,%70 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \71 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%72 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%73 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%74 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \75 &\\*[ −0.9em ] \ h l i n e76 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \77 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%78 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%79 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%80 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \81 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%82 \ T e x t F i e l d [ name=von , wid th =10em,%83 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \84 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%85 \ T e x t F i e l d [ name= b i s , w id th =10em,%86 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \87 &\\*[ −0.9em ] \ h l i n e88 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%89 \ t e x t b f {Zu s c h l i e \ s s {} ende T \ " { u} r e n } } \ \90 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ Haus t \ " { u} r :}&%91 \ CheckBox [ name=ht , w id th =1 .2em,%92 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \93 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%94 \ CheckBox [ name=e1 , wid th =1 .2em,%95 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \96 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%97 \ CheckBox [ name=e2 , wid th =1 .2em,%98 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \99 &\\

100 \ h l i n e101 \ end { t a b u l a r }102 \ end {Form}103 \ end { document }

26

In ex0009.pdf wird vor und nach dem Drucken die Umrandungs- und Füllfarbe geändert sowieder Textfont. Hierzu werden die Attribute fillColor, strokeColor und textFont geändert. Damitnicht nach jeder einzelnen Änderung ein Bildschirm-Refresh erfolgt, werden die Änderungenin

1 t h i s . d e l a y = t r u e2 / / . . .3 t h i s . d e l a y = f a l s e

gekapselt. Dies schiebt den Bildschirm-Refresh solange auf, bis alle Änderungen vorgenom-men wurden.

In myFirstJavaScriptFunction() werden für die Auswahllisten abt und zeit mit

1 t h i s . g e t F i e l d ( " a b t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;2 t h i s . g e t F i e l d ( " z e i t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;

Standardeinträge vorgewählt.Mit

1 t h i s . g e t F i e l d ( " vorname " ) . s e t F o c u s ( ) ;

erhält das Eingabefeld vorname den Fokus (d. h. der Cursor wird in dieses Eingabefeld plat-ziert und das Eingabefeld erhält die Tastatureingaben).

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ immedia te \ p d f o b j {24 <<

27

25 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>26 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>27 >>28 }29 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}30 \ b e g i n { insDLJS } [ exaaad ] { exaaad }{ J a v a S c r i p t a u f Document Leve l }31

32 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run33 v a r done = 0 ;34

35 f u n c t i o n c o l o r s P r i n t i n g ( )36 {37 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = c o l o r . w h i t e ;38 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = c o l o r . w h i t e ;39 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = c o l o r . w h i t e ;40 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = c o l o r . w h i t e ;41 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = c o l o r . w h i t e ;42 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = c o l o r . w h i t e ;43 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = c o l o r . w h i t e ;44 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = c o l o r . w h i t e ;45 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = c o l o r . w h i t e ;46

47 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = c o l o r . b l a c k ;48 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = c o l o r . b l a c k ;49 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;50 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;51 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = c o l o r . b l a c k ;52 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = c o l o r . b l a c k ;53 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;54 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;55 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;56

57 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . Helv ;58 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . Helv ;59 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . Helv ;60 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . Helv ;61 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . Helv ;62 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . Helv ;63 }64

65 f u n c t i o n c o l o r s S c r e e n ( )66 {67

68 v a r newco lo r = [ "RGB" , 0 . 6 5 , 0 . 7 9 , 0 . 9 4 ] ;

28

69 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = newco lo r ;70 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = newco lo r ;71 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = newco lo r ;72 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = newco lo r ;73 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = newco lo r ;74 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = newco lo r ;75 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = newco lo r ;76 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = newco lo r ;77 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = newco lo r ;78

79 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = newco lo r ;80 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = newco lo r ;81 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = newco lo r ;82 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = newco lo r ;83 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = newco lo r ;84 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = newco lo r ;85 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = newco lo r ;86 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = newco lo r ;87 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = newco lo r ;88

89 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . HelvB ;90 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . HelvB ;91 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . HelvB ;92 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . HelvB ;93 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . HelvB ;94 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . HelvB ;95 }96

97 f u n c t i o n w i l l P r i n t ( )98 {99 t h i s . d e l a y = t r u e ;

100 c o l o r s P r i n t i n g ( ) ;101 t h i s . d e l a y = f a l s e ;102 }103

104 f u n c t i o n d i d P r i n t ( )105 {106 t h i s . d e l a y = t r u e ;107 c o l o r s S c r e e n ( ) ;108 t h i s . d e l a y = f a l s e ;109 }110

111 / / f u n c t i o n t o run when open ing t h e document112 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )

29

113 {114 i f ( ! done ) {115 done = 1 ;116 t h i s . d e l a y = t r u e ;117 c o l o r s S c r e e n ( ) ;118 t h i s . g e t F i e l d ( " a b t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;119 t h i s . g e t F i e l d ( " z e i t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;120 t h i s . g e t F i e l d ( " vorname " ) . s e t F o c u s ( ) ;121 t h i s . d e l a y = f a l s e ;122 }123 }124 \ end { insDLJS }125 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }126 \ newcommand { \ t e x t f o r l a b e l }[2]{%127 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%128 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%129 }130 \ b e g i n { document }131 \ s e c t i o n *{ Anforde rung e i n e s Gruppensch l \ " { u} s s e l s }132 \ b e g i n {Form}133 \ b e g i n { t a b u l a r } { | r l | }134 \ h l i n e135 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \136 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%137 \ T e x t F i e l d [ name=vorname , wid th =20em,%138 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \139 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%140 \ T e x t F i e l d [ name=name , wid th =20em,%141 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \142 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%143 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%144 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%145 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \146 &\\*[ −0.9em ] \ h l i n e147 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \148 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%149 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%150 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%151 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \152 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%153 \ T e x t F i e l d [ name=von , wid th =10em,%154 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \155 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%156 \ T e x t F i e l d [ name= b i s , w id th =10em,%

30

157 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \158 &\\*[ −0.9em ] \ h l i n e159 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%160 \ t e x t b f {Zu s c h l i e \ s s {} ende T \ " { u} r e n } } \ \161 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ Haus t \ " { u} r :}&%162 \ CheckBox [ name=ht , w id th =1 .2em,%163 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \164 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%165 \ CheckBox [ name=e1 , wid th =1 .2em,%166 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \167 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%168 \ CheckBox [ name=e2 , wid th =1 .2em,%169 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \170 &\\171 \ h l i n e172 \ end { t a b u l a r }173 \ end {Form}174 \ end { document }

31

4.9 Formularfeld-Ereignisse: ex0010Ereignisse können nicht nur vom Dokument sondern auch von einzelnen Formularfeldern aus-gelöst werden. Im Beispiel wird der Auswahlliste zeit der Parameter

1 v a l i d a t e ={ v a l i d a t e T i m e ( ) ; }

übergeben. Immer dann, wenn das Eingabefeld verlassen wird, wird die Funktion validateTi-me(); aufgerufen. Diese macht mit

1 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . v i s i b l e ;2 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . v i s i b l e ;

bzw.

1 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . h id de n ;2 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . h id de n ;

die Eingabefelder von und bis sichtbar bzw. unsichtbar.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ immedia te \ p d f o b j {24 <<25 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>26 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>27 >>28 }

32

29 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}30 \ b e g i n { insDLJS } [ e xa a ae ] { e xa a ae }{ J a v a S c r i p t a u f Document Leve l }31

32 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run33 v a r done = 0 ;34

35 f u n c t i o n c o l o r s P r i n t i n g ( )36 {37 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = c o l o r . w h i t e ;38 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = c o l o r . w h i t e ;39 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = c o l o r . w h i t e ;40 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = c o l o r . w h i t e ;41 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = c o l o r . w h i t e ;42 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = c o l o r . w h i t e ;43 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = c o l o r . w h i t e ;44 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = c o l o r . w h i t e ;45 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = c o l o r . w h i t e ;46

47 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = c o l o r . b l a c k ;48 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = c o l o r . b l a c k ;49 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;50 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;51 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = c o l o r . b l a c k ;52 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = c o l o r . b l a c k ;53 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;54 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;55 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;56

57 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . Helv ;58 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . Helv ;59 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . Helv ;60 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . Helv ;61 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . Helv ;62 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . Helv ;63 t h i s . g e t F i e l d ( " von " ) . t e x t C o l o r = c o l o r . b l a c k ;64 t h i s . g e t F i e l d ( " b i s " ) . t e x t C o l o r = c o l o r . b l a c k ;65 }66

67 f u n c t i o n c o l o r s S c r e e n ( )68 {69

70 v a r newco lo r = [ "RGB" , 0 . 6 5 , 0 . 7 9 , 0 . 9 4 ] ;71 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = newco lo r ;72 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = newco lo r ;

33

73 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = newco lo r ;74 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = newco lo r ;75 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = newco lo r ;76 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = newco lo r ;77 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = newco lo r ;78 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = newco lo r ;79 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = newco lo r ;80

81 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = newco lo r ;82 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = newco lo r ;83 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = newco lo r ;84 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = newco lo r ;85 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = newco lo r ;86 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = newco lo r ;87 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = newco lo r ;88 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = newco lo r ;89 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = newco lo r ;90

91 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . HelvB ;92 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . HelvB ;93 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . HelvB ;94 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . HelvB ;95 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . HelvB ;96 t h i s . g e t F i e l d ( " von " ) . t e x t C o l o r = c o l o r . b l a c k ;97 t h i s . g e t F i e l d ( " b i s " ) . t e x t C o l o r = c o l o r . b l a c k ;98 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . HelvB ;99 }

100

101 f u n c t i o n v a l i d a t e T i m e ( )102 {103 t h i s . d e l a y = t r u e ;104 i f ( ( e v e n t . v a l u e == " u " ) | | ( e v e n t . v a l u e == " u n b e f r i s t e t " ) ) {105 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . h id de n ;106 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . h id de n ;107 } e l s e {108 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . v i s i b l e ;109 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . v i s i b l e ;110 t h i s . g e t F i e l d ( " von " ) . s e t F o c u s ( ) ;111 }112 t h i s . d e l a y = f a l s e ;113 }114

115 f u n c t i o n w i l l P r i n t ( )116 {

34

117 t h i s . d e l a y = t r u e ;118 c o l o r s P r i n t i n g ( ) ;119 t h i s . d e l a y = f a l s e ;120 }121

122 f u n c t i o n d i d P r i n t ( )123 {124 t h i s . d e l a y = t r u e ;125 c o l o r s S c r e e n ( ) ;126 t h i s . d e l a y = f a l s e ;127 }128

129 / / f u n c t i o n t o run when open ing t h e document130 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )131 {132 i f ( ! done ) {133 done = 1 ;134 t h i s . d e l a y = t r u e ;135 c o l o r s S c r e e n ( ) ;136 t h i s . g e t F i e l d ( " a b t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;137 t h i s . g e t F i e l d ( " z e i t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;138 t h i s . g e t F i e l d ( " vorname " ) . s e t F o c u s ( ) ;139 t h i s . d e l a y = f a l s e ;140 }141 }142 \ end { insDLJS }143 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }144 \ newcommand { \ t e x t f o r l a b e l }[2]{%145 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%146 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%147 }148 \ b e g i n { document }149 \ s e c t i o n *{ Anforde rung e i n e s Gruppensch l \ " { u} s s e l s }150 \ b e g i n {Form}151 \ b e g i n { t a b u l a r } { | r l | }152 \ h l i n e153 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \154 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%155 \ T e x t F i e l d [ name=vorname , wid th =20em,%156 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \157 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%158 \ T e x t F i e l d [ name=name , wid th =20em,%159 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \160 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%

35

161 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , v a l u e =v,%162 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%163 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \164 &\\*[ −0.9em ] \ h l i n e165 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \166 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%167 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%168 v a l i d a t e ={ v a l i d a t e T i m e ( ) ; } , %169 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%170 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \171 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%172 \ T e x t F i e l d [ name=von , wid th =10em,%173 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \174 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%175 \ T e x t F i e l d [ name= b i s , w id th =10em,%176 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \177 &\\*[ −0.9em ] \ h l i n e178 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%179 \ t e x t b f {Zu s c h l i e \ s s {} ende T \ " { u} r e n } } \ \180 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ Haus t \ " { u} r :}&%181 \ CheckBox [ name=ht , w id th =1 .2em,%182 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \183 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%184 \ CheckBox [ name=e1 , wid th =1 .2em,%185 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \186 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%187 \ CheckBox [ name=e2 , wid th =1 .2em,%188 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \189 &\\190 \ h l i n e191 \ end { t a b u l a r }192 \ end {Form}193 \ end { document }

36

4.10 Editierbare Auswahlliste: ex0011In der Auswahlliste abt soll es nicht nur die Auswahl eines vorhandenen Elementes sondernauch die Eingabe von Text möglich sein. Zu diesem Zweck wird beim Anlegen der Liste derParameter

1 combo= t r u e

mit angegeben. Da dieser allein nicht immer genügt, wird zusätzlich noch eine JavaScript-Zeile

1 t h i s . g e t F i e l d ( " a b t " ) . e d i t a b l e = t r u e ;

in myFirstJavaScriptFunction() eingefügt.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S c h l ü s s e l a u s g a b e } , p d f s u b j e c t ={ Zugang } ,18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ immedia te \ p d f o b j {24 <<25 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>26 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>27 >>28 }29 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}30 \ b e g i n { insDLJS } [ e xa a ae ] { e xa a ae }{ J a v a S c r i p t a u f Document Leve l }31

32 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run

37

33 v a r done = 0 ;34

35 f u n c t i o n c o l o r s P r i n t i n g ( )36 {37 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = c o l o r . w h i t e ;38 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = c o l o r . w h i t e ;39 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = c o l o r . w h i t e ;40 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = c o l o r . w h i t e ;41 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = c o l o r . w h i t e ;42 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = c o l o r . w h i t e ;43 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = c o l o r . w h i t e ;44 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = c o l o r . w h i t e ;45 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = c o l o r . w h i t e ;46

47 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = c o l o r . b l a c k ;48 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = c o l o r . b l a c k ;49 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;50 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;51 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = c o l o r . b l a c k ;52 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = c o l o r . b l a c k ;53 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = c o l o r . b l a c k ;54 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;55 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;56

57 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . Helv ;58 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . Helv ;59 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . Helv ;60 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . Helv ;61 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . Helv ;62 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . Helv ;63 t h i s . g e t F i e l d ( " von " ) . t e x t C o l o r = c o l o r . b l a c k ;64 t h i s . g e t F i e l d ( " b i s " ) . t e x t C o l o r = c o l o r . b l a c k ;65 }66

67 f u n c t i o n c o l o r s S c r e e n ( )68 {69

70 v a r newco lo r = [ "RGB" , 0 . 6 5 , 0 . 7 9 , 0 . 9 4 ] ;71 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = newco lo r ;72 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = newco lo r ;73 t h i s . g e t F i e l d ( " a b t " ) . f i l l C o l o r = newco lo r ;74 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = newco lo r ;75 t h i s . g e t F i e l d ( " von " ) . f i l l C o l o r = newco lo r ;76 t h i s . g e t F i e l d ( " b i s " ) . f i l l C o l o r = newco lo r ;

38

77 t h i s . g e t F i e l d ( " h t " ) . f i l l C o l o r = newco lo r ;78 t h i s . g e t F i e l d ( " e1 " ) . f i l l C o l o r = newco lo r ;79 t h i s . g e t F i e l d ( " e2 " ) . f i l l C o l o r = newco lo r ;80

81 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = newco lo r ;82 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = newco lo r ;83 t h i s . g e t F i e l d ( " a b t " ) . s t r o k e C o l o r = newco lo r ;84 t h i s . g e t F i e l d ( " z e i t " ) . s t r o k e C o l o r = newco lo r ;85 t h i s . g e t F i e l d ( " von " ) . s t r o k e C o l o r = newco lo r ;86 t h i s . g e t F i e l d ( " b i s " ) . s t r o k e C o l o r = newco lo r ;87 t h i s . g e t F i e l d ( " h t " ) . s t r o k e C o l o r = newco lo r ;88 t h i s . g e t F i e l d ( " e1 " ) . s t r o k e C o l o r = newco lo r ;89 t h i s . g e t F i e l d ( " e2 " ) . s t r o k e C o l o r = newco lo r ;90

91 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . HelvB ;92 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . HelvB ;93 t h i s . g e t F i e l d ( " a b t " ) . t e x t F o n t = f o n t . HelvB ;94 t h i s . g e t F i e l d ( " z e i t " ) . t e x t F o n t = f o n t . HelvB ;95 t h i s . g e t F i e l d ( " von " ) . t e x t F o n t = f o n t . HelvB ;96 t h i s . g e t F i e l d ( " von " ) . t e x t C o l o r = c o l o r . b l a c k ;97 t h i s . g e t F i e l d ( " b i s " ) . t e x t C o l o r = c o l o r . b l a c k ;98 t h i s . g e t F i e l d ( " b i s " ) . t e x t F o n t = f o n t . HelvB ;99 }

100

101 f u n c t i o n v a l i d a t e T i m e ( )102 {103 t h i s . d e l a y = t r u e ;104 i f ( ( e v e n t . v a l u e == " u " ) | | ( e v e n t . v a l u e == " u n b e f r i s t e t " ) ) {105 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . h id de n ;106 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . h id de n ;107 } e l s e {108 t h i s . g e t F i e l d ( " von " ) . d i s p l a y = d i s p l a y . v i s i b l e ;109 t h i s . g e t F i e l d ( " b i s " ) . d i s p l a y = d i s p l a y . v i s i b l e ;110 t h i s . g e t F i e l d ( " von " ) . s e t F o c u s ( ) ;111 }112 t h i s . d e l a y = f a l s e ;113 }114

115 f u n c t i o n w i l l P r i n t ( )116 {117 t h i s . d e l a y = t r u e ;118 c o l o r s P r i n t i n g ( ) ;119 t h i s . d e l a y = f a l s e ;120 }

39

121

122 f u n c t i o n d i d P r i n t ( )123 {124 t h i s . d e l a y = t r u e ;125 c o l o r s S c r e e n ( ) ;126 t h i s . d e l a y = f a l s e ;127 }128

129 / / f u n c t i o n t o run when open ing t h e document130 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )131 {132 i f ( ! done ) {133 done = 1 ;134 t h i s . d e l a y = t r u e ;135 c o l o r s S c r e e n ( ) ;136 t h i s . g e t F i e l d ( " a b t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;137 t h i s . g e t F i e l d ( " a b t " ) . e d i t a b l e = t r u e ;138 t h i s . g e t F i e l d ( " z e i t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;139 t h i s . g e t F i e l d ( " vorname " ) . s e t F o c u s ( ) ;140 t h i s . d e l a y = f a l s e ;141 }142 }143 \ end { insDLJS }144 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }145 \ newcommand { \ t e x t f o r l a b e l }[2]{%146 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%147 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%148 }149 \ b e g i n { document }150 \ s e c t i o n *{ Anforde rung e i n e s Gruppensch l \ " { u} s s e l s }151 \ b e g i n {Form}152 \ b e g i n { t a b u l a r } { | r l | }153 \ h l i n e154 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { M i t a r b e i t e r } } \ \155 &\\*[ −0.9em ] \ t e x t f o r l a b e l { vn }{ Vorname:}&%156 \ T e x t F i e l d [ name=vorname , wid th =20em,%157 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \158 &\\*[ −0.9em ] \ t e x t f o r l a b e l { nn }{Name:}&%159 \ T e x t F i e l d [ name=name , wid th =20em,%160 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \161 &\\*[ −0.9em ] \ t e x t f o r l a b e l { ab }{ A b t e i l u n g :}&%162 \ ChoiceMenu [ name= abt , w id th =20em , popdown= t r u e , combo= t r u e , v a l u e =v,%163 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%164 Verkauf =v , F e r t i g u n g =f , S e r v i c e =s } \ \

40

165 &\\*[ −0.9em ] \ h l i n e166 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { Z e i t d a u e r } } \ \167 &\\*[ −0.9em ] \ t e x t f o r l a b e l { z }{ Z e i t r a u m :}&%168 \ ChoiceMenu [ name= z e i t , w id th =20em , popdown= t r u e , v a l u e =u,%169 v a l i d a t e ={ v a l i d a t e T i m e ( ) ; } , %170 b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}{%171 u n b e f r i s t e t =u , b e f r i s t e t =b } \ \172 &\\*[ −0.9em ] \ t e x t f o r l a b e l {v }{ von:}&%173 \ T e x t F i e l d [ name=von , wid th =10em,%174 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \175 &\\*[ −0.9em ] \ t e x t f o r l a b e l {b }{ b i s :}&%176 \ T e x t F i e l d [ name= b i s , w id th =10em,%177 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \178 &\\*[ −0.9em ] \ h l i n e179 &\\*[ −0.9em ] \ mu l t i co lumn { 2 } { | c |}{%180 \ t e x t b f {Zu s c h l i e \ s s {} ende T \ " { u} r e n } } \ \181 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t h }{ Haus t \ " { u} r :}&%182 \ CheckBox [ name=ht , w id th =1 .2em,%183 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \184 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 1 }{ Etage 1:}&%185 \ CheckBox [ name=e1 , wid th =1 .2em,%186 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \187 &\\*[ −0.9em ] \ t e x t f o r l a b e l { t 2 }{ Etage 2:}&%188 \ CheckBox [ name=e2 , wid th =1 .2em,%189 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \190 &\\191 \ h l i n e192 \ end { t a b u l a r }193 \ end {Form}194 \ end { document }

41

4.11 Online-Hilfe4.11.1 Übersicht

Dem Nutzer, der das Formular ausfült, kann auf verschiedene Weise Online-Hilfe zur Ver-füung gestellt werden:

• PDF-Annotationen (Notizen)Im Text werden Notizen durch ein Icon angezeigt. Bewegt der Nutzer die Maus überdas Icon, wird der Notiztext als Tooltip angezeigt. Ein Doppelklick auf das Icon öffnetdie Notiz.Vorteil dieses Verfahrens: Es ist nicht notwendig, dass im Anzeigeprogramm JavaScriptaktiviert ist. Nachteilig ist, dass die zusäzlichen Icons zum einen Platz benötigen undzum anderen das Formular unübersichtlicher wird.

• TooltipsTooltips werden angezeigt, wenn der Nutzer die Maus über ein Formularfeld bewegt unddie Maus dort verharren läst. Tooltips sind den meisten Nutzern bereits aus anderen An-wendungen bekannt. Da der Tooltip-Text (derzeit noch?2) nicht über die Formularfeld-Optionen von hyperref gesetzt werden kann, ist JavaScript im Anzeigeprogramm erfor-derlich, um Formularfeldern Tooltip-Texte zuzuweisen.

Die beiden Verfahren können auch kombiniert werden.

2Stand: 07.02.2008

42

4.11.2 PDF-Annotationen

Um nach einem Formularfeld ein Icon für Online-Hilfe anzubringen, kann folgender Codegenutzt werden:

1 ~ \ p d f a n n o t wid th 20 p t {2 / Sub type / Text3 / Name / Help4 / C [ 0 . 6 5 0 . 7 9 0 . 9 4 ]5 / T ( Not iz−Ü b e r s c h r i f t )6 / C o n t e n t s ( Der H i l f e t e x t d e r N o t i z )7 } \ ( \ qquad \ )

Das Notiz-Icon „verbraucht“ nach Ansicht von pdfLATEX keinen Platz, daher wird ein großerLeerraum nach der pdfannot-Anweisung eingefügt.Vor der Notiz wird ebenfalls etwas Leerraum eingefügt, um Abstand zum Formularfeld zuhalten.

„/Name /Help“ wählt ein Icon für die Notiz aus, in diesem Fall das Fragezeichen. Der Ein-trag „/C“ legt die Farbe für das Icon fest. Hier sollte dieselbe Farbe wie für die Formularfeldergenutzt werden.

Beispiel ex0012 demonstriert die Verwendung von PDF-Annotationen für die Hilfe.

4.11.3 Tooltips

Tooltip-Text kann einem Formularfeld mit der JavaScript-Anweisung

1 t h i s . g e t F i e l d ( " fe ldname " ) . userName = " Das i s t e i n H i l f e t e x t . " ;

hinzugefügt werden. Diese Anweisung sollte in der Funktion stehen, die beim Öffnen desDokumentes automatisch ausgeführt wird.

Beispiel ex0013 zeigt, wie Tooltip-Texte gesetzt werden. Wird das Paket „inputenc“ genutzt,müssen deutsche Umlaute im JavaScript-Code durch eine spezielle Notation ausgedrückt wer-den, siehe Abschnitt 7 auf Seite 55.

43

5 Ein weiteres Formular

5.1 AufgabenstellungEs soll ein Formular entworfen werden, mit dem Softwarelizenzen sowie die Installation derSoftware durch fachkundiges Personal angefordert werden können.

Die Angaben, wer die Installation anfordert und auf welchem PC die Software benötigtwird, werden in Textfelder eingegeben.Für die Auswahl der Software werden mehrere Auswahllisten bereitgestellt mit jeweils demgleichen Inhalt. Die Auswahllisten sollen editierbar sein, falls Spezialsoftware benötigt wird.

5.2 Auswahllisten mit JavaScript initialisieren: ex0101Die Auswahlmöglichkeiten in Auswahllisten können auch per JavaScript eingestellt werden.Dies ist sinnvoll, wenn mehrere Listen mit den gleichen Auswahlmöglichkeiten versehen wer-den sollen oder wenn viele Auswahlmöglichkeiten bestehen. In beiden Fällen wird die Über-sichtlichkeit der LATEX-Quelle erhöht.

Die Auswahlmöglichkeiten werden als Array angegeben. Jedes Element des Arrays ist sei-nerseits wiederum ein Array mit zwei Elementen. Das erste Element ist der Text, der in derAuswahlliste angezeigt werden soll. Das zweite Element ist eine Abkürzung, um die Auswahl-möglichkeit per JavaScript ansprechen zu können.Die Auswahlmöglichkeiten für ex0101 werden in einem Array softwareAuswahl aufgeführt:

1 v a r so f twa reA uswah l = [2 [ " " , " " ] ,3 [ " B e t r i e b s s y s t e m " , " os " ] ,4 [ " T e x t v e r a r b e i t u n g " , " t p " ] ,5 [ " T a b e l l e n k a l k u l a t i o n " , " sc " ] ,6 [ " P r ä s e n t a t i o n s p r o g r a m m " , " pp " ] ,7 [ "E−Mail−C l i e n t " , "mc" ] ,8 [ "Web browse r " , "wb" ] ,9 [ " Mathematik−S o f t w a r e " , "ms" ] ,

10 [ "PDF−Anzeigeprogramm " , " pv " ]11 ] ;

Über die setItems()-Methode

1 t h i s . g e t F i e l d ( " sw01 " ) . s e t I t e m s ( so f twa reAu swah l ) ;

wird das Array mit den entsprechenden Auswahllisten verknüpft.

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ T1 ] { f o n t e n c }3 \ u s e p a c k a g e { tex tcomp }4 \ u s e p a c k a g e { mathptmx }5 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }6 \ u s e p a c k a g e { c o u r i e r }

44

7 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }8 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }9 \ u s e p a c k a g e { f a n c y h d r }

10 \ l h e a d { Firma ABC} \ chead { } \ r h e a d { A b t e i l u n g XYZ}11 \ l f o o t { } \ c f o o t { } \ r f o o t {}12 \ p a g e s t y l e { f a n c y }13 \ u s e p a c k a g e { g r a p h i c x }14 \ u s e p a c k a g e { c o l o r }15 \ u s e p a c k a g e [16 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,17 p d f t i t l e ={ Formula r f ü r S o f t w a r e } , p d f s u b j e c t ={ S o f t w a r e } ,18 p d f a u t h o r ={ i c h } ,19 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,20 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}21 ] { h y p e r r e f }22 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }23 \ immedia te \ p d f o b j {24 <<25 /WP << / S / J a v a S c r i p t / JS ( w i l l P r i n t ( ) ; ) >>26 / DP << / S / J a v a S c r i p t / JS ( d i d P r i n t ( ) ; ) >>27 >>28 }29 \ p d f c a t a l o g { /AA \ t h e \ p d f l a s t o b j \ s p a c e 0 R}30 \ b e g i n { insDLJS } [ exaaba ] { exaaba }{ J a v a S c r i p t a u f Document Leve l }31

32 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run33 v a r done = 0 ;34

35 f u n c t i o n c o l o r s P r i n t i n g ( )36 {37 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = c o l o r . w h i t e ;38 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = c o l o r . b l a c k ;39 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . Helv ;40 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = c o l o r . w h i t e ;41 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = c o l o r . b l a c k ;42 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . Helv ;43 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . f i l l C o l o r = c o l o r . w h i t e ;44 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . s t r o k e C o l o r = c o l o r . b l a c k ;45 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . t e x t F o n t = f o n t . Helv ;46 t h i s . g e t F i e l d ( " sw01 " ) . f i l l C o l o r = c o l o r . w h i t e ;47 t h i s . g e t F i e l d ( " sw01 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;48 t h i s . g e t F i e l d ( " sw01 " ) . t e x t F o n t = f o n t . Helv ;49 t h i s . g e t F i e l d ( " sw02 " ) . f i l l C o l o r = c o l o r . w h i t e ;50 t h i s . g e t F i e l d ( " sw02 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;

45

51 t h i s . g e t F i e l d ( " sw02 " ) . t e x t F o n t = f o n t . Helv ;52 t h i s . g e t F i e l d ( " sw03 " ) . f i l l C o l o r = c o l o r . w h i t e ;53 t h i s . g e t F i e l d ( " sw03 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;54 t h i s . g e t F i e l d ( " sw03 " ) . t e x t F o n t = f o n t . Helv ;55 t h i s . g e t F i e l d ( " sw04 " ) . f i l l C o l o r = c o l o r . w h i t e ;56 t h i s . g e t F i e l d ( " sw04 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;57 t h i s . g e t F i e l d ( " sw04 " ) . t e x t F o n t = f o n t . Helv ;58 t h i s . g e t F i e l d ( " sw05 " ) . f i l l C o l o r = c o l o r . w h i t e ;59 t h i s . g e t F i e l d ( " sw05 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;60 t h i s . g e t F i e l d ( " sw05 " ) . t e x t F o n t = f o n t . Helv ;61 t h i s . g e t F i e l d ( " sw06 " ) . f i l l C o l o r = c o l o r . w h i t e ;62 t h i s . g e t F i e l d ( " sw06 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;63 t h i s . g e t F i e l d ( " sw06 " ) . t e x t F o n t = f o n t . Helv ;64 t h i s . g e t F i e l d ( " sw07 " ) . f i l l C o l o r = c o l o r . w h i t e ;65 t h i s . g e t F i e l d ( " sw07 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;66 t h i s . g e t F i e l d ( " sw07 " ) . t e x t F o n t = f o n t . Helv ;67 t h i s . g e t F i e l d ( " sw08 " ) . f i l l C o l o r = c o l o r . w h i t e ;68 t h i s . g e t F i e l d ( " sw08 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;69 t h i s . g e t F i e l d ( " sw08 " ) . t e x t F o n t = f o n t . Helv ;70 t h i s . g e t F i e l d ( " sw09 " ) . f i l l C o l o r = c o l o r . w h i t e ;71 t h i s . g e t F i e l d ( " sw09 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;72 t h i s . g e t F i e l d ( " sw09 " ) . t e x t F o n t = f o n t . Helv ;73 t h i s . g e t F i e l d ( " sw10 " ) . f i l l C o l o r = c o l o r . w h i t e ;74 t h i s . g e t F i e l d ( " sw10 " ) . s t r o k e C o l o r = c o l o r . b l a c k ;75 t h i s . g e t F i e l d ( " sw10 " ) . t e x t F o n t = f o n t . Helv ;76 }77

78 f u n c t i o n c o l o r s S c r e e n ( )79 {80

81 v a r newco lo r = [ "RGB" , 0 . 6 5 , 0 . 7 9 , 0 . 9 4 ] ;82 t h i s . g e t F i e l d ( " vorname " ) . f i l l C o l o r = newco lo r ;83 t h i s . g e t F i e l d ( " vorname " ) . s t r o k e C o l o r = newco lo r ;84 t h i s . g e t F i e l d ( " vorname " ) . t e x t F o n t = f o n t . HelvB ;85 t h i s . g e t F i e l d ( " name " ) . f i l l C o l o r = newco lo r ;86 t h i s . g e t F i e l d ( " name " ) . s t r o k e C o l o r = newco lo r ;87 t h i s . g e t F i e l d ( " name " ) . t e x t F o n t = f o n t . HelvB ;88 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . f i l l C o l o r = newco lo r ;89 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . s t r o k e C o l o r = newco lo r ;90 t h i s . g e t F i e l d ( " i n v e n t o r y " ) . t e x t F o n t = f o n t . HelvB ;91 t h i s . g e t F i e l d ( " sw01 " ) . f i l l C o l o r = newco lo r ;92 t h i s . g e t F i e l d ( " sw01 " ) . s t r o k e C o l o r = newco lo r ;93 t h i s . g e t F i e l d ( " sw01 " ) . t e x t F o n t = f o n t . HelvB ;94 t h i s . g e t F i e l d ( " sw02 " ) . f i l l C o l o r = newco lo r ;

46

95 t h i s . g e t F i e l d ( " sw02 " ) . s t r o k e C o l o r = newco lo r ;96 t h i s . g e t F i e l d ( " sw02 " ) . t e x t F o n t = f o n t . HelvB ;97 t h i s . g e t F i e l d ( " sw03 " ) . f i l l C o l o r = newco lo r ;98 t h i s . g e t F i e l d ( " sw03 " ) . s t r o k e C o l o r = newco lo r ;99 t h i s . g e t F i e l d ( " sw03 " ) . t e x t F o n t = f o n t . HelvB ;

100 t h i s . g e t F i e l d ( " sw04 " ) . f i l l C o l o r = newco lo r ;101 t h i s . g e t F i e l d ( " sw04 " ) . s t r o k e C o l o r = newco lo r ;102 t h i s . g e t F i e l d ( " sw04 " ) . t e x t F o n t = f o n t . HelvB ;103 t h i s . g e t F i e l d ( " sw05 " ) . f i l l C o l o r = newco lo r ;104 t h i s . g e t F i e l d ( " sw05 " ) . s t r o k e C o l o r = newco lo r ;105 t h i s . g e t F i e l d ( " sw05 " ) . t e x t F o n t = f o n t . HelvB ;106 t h i s . g e t F i e l d ( " sw06 " ) . f i l l C o l o r = newco lo r ;107 t h i s . g e t F i e l d ( " sw06 " ) . s t r o k e C o l o r = newco lo r ;108 t h i s . g e t F i e l d ( " sw06 " ) . t e x t F o n t = f o n t . HelvB ;109 t h i s . g e t F i e l d ( " sw07 " ) . f i l l C o l o r = newco lo r ;110 t h i s . g e t F i e l d ( " sw07 " ) . s t r o k e C o l o r = newco lo r ;111 t h i s . g e t F i e l d ( " sw07 " ) . t e x t F o n t = f o n t . HelvB ;112 t h i s . g e t F i e l d ( " sw08 " ) . f i l l C o l o r = newco lo r ;113 t h i s . g e t F i e l d ( " sw08 " ) . s t r o k e C o l o r = newco lo r ;114 t h i s . g e t F i e l d ( " sw08 " ) . t e x t F o n t = f o n t . HelvB ;115 t h i s . g e t F i e l d ( " sw09 " ) . f i l l C o l o r = newco lo r ;116 t h i s . g e t F i e l d ( " sw09 " ) . s t r o k e C o l o r = newco lo r ;117 t h i s . g e t F i e l d ( " sw09 " ) . t e x t F o n t = f o n t . HelvB ;118 t h i s . g e t F i e l d ( " sw10 " ) . f i l l C o l o r = newco lo r ;119 t h i s . g e t F i e l d ( " sw10 " ) . s t r o k e C o l o r = newco lo r ;120 t h i s . g e t F i e l d ( " sw10 " ) . t e x t F o n t = f o n t . HelvB ;121 }122

123 f u n c t i o n w i l l P r i n t ( )124 {125 t h i s . d e l a y = t r u e ;126 c o l o r s P r i n t i n g ( ) ;127 t h i s . d e l a y = f a l s e ;128 }129

130 f u n c t i o n d i d P r i n t ( )131 {132 t h i s . d e l a y = t r u e ;133 c o l o r s S c r e e n ( ) ;134 t h i s . d e l a y = f a l s e ;135 }136

137 v a r s o f twa reA uswah l = [138 [ " " , " " ] ,

47

139 [ " B e t r i e b s s y s t e m " , " os " ] ,140 [ " T e x t v e r a r b e i t u n g " , " t p " ] ,141 [ " T a b e l l e n k a l k u l a t i o n " , " sc " ] ,142 [ " P r ä s e n t a t i o n s p r o g r a m m " , " pp " ] ,143 [ "E−Mail−C l i e n t " , "mc" ] ,144 [ "Web browse r " , "wb" ] ,145 [ " Mathematik−S o f t w a r e " , "ms" ] ,146 [ "PDF−Anzeigeprogramm " , " pv " ]147 ] ;148

149 / / f u n c t i o n t o run when open ing t h e document150 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )151 {152 i f ( ! done ) {153 done = 1 ;154 t h i s . d e l a y = t r u e ;155 c o l o r s S c r e e n ( ) ;156 t h i s . g e t F i e l d ( " sw01 " ) . s e t I t e m s ( so f twa reAu swah l ) ;157 t h i s . g e t F i e l d ( " sw01 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;158 t h i s . g e t F i e l d ( " sw01 " ) . e d i t a b l e = t r u e ;159 t h i s . g e t F i e l d ( " sw02 " ) . s e t I t e m s ( so f twa reAu swah l ) ;160 t h i s . g e t F i e l d ( " sw02 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;161 t h i s . g e t F i e l d ( " sw02 " ) . e d i t a b l e = t r u e ;162 t h i s . g e t F i e l d ( " sw03 " ) . s e t I t e m s ( so f twa reAu swah l ) ;163 t h i s . g e t F i e l d ( " sw03 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;164 t h i s . g e t F i e l d ( " sw03 " ) . e d i t a b l e = t r u e ;165 t h i s . g e t F i e l d ( " sw04 " ) . s e t I t e m s ( so f twa reAu swah l ) ;166 t h i s . g e t F i e l d ( " sw04 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;167 t h i s . g e t F i e l d ( " sw04 " ) . e d i t a b l e = t r u e ;168 t h i s . g e t F i e l d ( " sw05 " ) . s e t I t e m s ( so f twa reAu swah l ) ;169 t h i s . g e t F i e l d ( " sw05 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;170 t h i s . g e t F i e l d ( " sw05 " ) . e d i t a b l e = t r u e ;171 t h i s . g e t F i e l d ( " sw06 " ) . s e t I t e m s ( so f twa reAu swah l ) ;172 t h i s . g e t F i e l d ( " sw06 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;173 t h i s . g e t F i e l d ( " sw06 " ) . e d i t a b l e = t r u e ;174 t h i s . g e t F i e l d ( " sw07 " ) . s e t I t e m s ( so f twa reAu swah l ) ;175 t h i s . g e t F i e l d ( " sw07 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;176 t h i s . g e t F i e l d ( " sw07 " ) . e d i t a b l e = t r u e ;177 t h i s . g e t F i e l d ( " sw08 " ) . s e t I t e m s ( so f twa reAu swah l ) ;178 t h i s . g e t F i e l d ( " sw08 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;179 t h i s . g e t F i e l d ( " sw08 " ) . e d i t a b l e = t r u e ;180 t h i s . g e t F i e l d ( " sw09 " ) . s e t I t e m s ( so f twa reAu swah l ) ;181 t h i s . g e t F i e l d ( " sw09 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;182 t h i s . g e t F i e l d ( " sw09 " ) . e d i t a b l e = t r u e ;

48

183 t h i s . g e t F i e l d ( " sw10 " ) . s e t I t e m s ( so f twa reAu swah l ) ;184 t h i s . g e t F i e l d ( " sw10 " ) . c u r r e n t V a l u e I n d i c e s = 0 ;185 t h i s . g e t F i e l d ( " sw10 " ) . e d i t a b l e = t r u e ;186 t h i s . g e t F i e l d ( " vorname " ) . s e t F o c u s ( ) ;187 t h i s . d e l a y = f a l s e ;188 }189 }190 \ end { insDLJS }191 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }192 \ newcommand { \ t e x t f o r l a b e l }[2]{%193 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =9em , a l i g n =2,%194 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%195 }196 \ b e g i n { document }197 \ s e c t i o n *{ Anforde rung von Sof tware−L i z e n z e n und − i n s t a l l a t i o n e n }198 \ b e g i n {Form}199 \ b e g i n { t a b u l a r } { | r r | }200 \ h l i n e201 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]202 \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f { S y s t e m v e r a n t w o r t l i c h e r } } \ \203 &\\*[ −0.9em ] \ t e x t f o r l a b e l { l 0 1 }{ Vorname :}&\ T e x t F i e l d [%204 name=vorname , wid th =20em , b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \205 &\\*[ −0.9em ] \ t e x t f o r l a b e l { l 0 2 }{Name:}&\ T e x t F i e l d [%206 name=name , wid th =20em , b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \207 &\\*[ −0.9em ] \ h l i n e208 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]209 \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {PC } } \ \210 &\\*[ −0.9em ] \ t e x t f o r l a b e l { l 0 3 }{ Inven ta rnummer :}%211 &\ T e x t F i e l d [ name= i n v e n t o r y , wid th =20em,%212 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } \ \213 &\\*[ −0.9em ] \ h l i n e214 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]215 \ mu l t i co lumn { 2 } { | c | } { \ t e x t b f {Ben \ " { o} t i g t e S o f t w a r e } } \ \216 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]217 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw01 , wid th =30em,%218 popdown= t r u e , combo= t r u e , v a l u e ={} ,%219 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \220 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]221 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw02 , wid th =30em,%222 popdown= t r u e , combo= t r u e , v a l u e ={} ,%223 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \224 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]225 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw03 , wid th =30em,%226 popdown= t r u e , combo= t r u e , v a l u e ={} ,%

49

227 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \228 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]229 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw04 , wid th =30em,%230 popdown= t r u e , combo= t r u e , v a l u e ={} ,%231 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \232 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]233 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw05 , wid th =30em,%234 popdown= t r u e , combo= t r u e , v a l u e ={} ,%235 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \236 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]237 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw06 , wid th =30em,%238 popdown= t r u e , combo= t r u e , v a l u e ={} ,%239 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \240 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]241 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw07 , wid th =30em,%242 popdown= t r u e , combo= t r u e , v a l u e ={} ,%243 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \244 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]245 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw08 , wid th =30em,%246 popdown= t r u e , combo= t r u e , v a l u e ={} ,%247 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \248 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]249 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw09 , wid th =30em,%250 popdown= t r u e , combo= t r u e , v a l u e ={} ,%251 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \252 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 9 em ]253 \ mu l t i co lumn { 2 } { | r | } { \ ChoiceMenu [ name=sw10 , wid th =30em,%254 popdown= t r u e , combo= t r u e , v a l u e ={} ,%255 b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } { } } \ \256 \ mu l t i co lumn { 2 } { | c | } { ~ } \ \ * \ h l i n e257 \ end { t a b u l a r }258 \ end {Form}259 \ end { document }

50

6 Formular Nummer drei: Interaktive Anwendung

6.1 AufgabenstellungDas dritte Formular soll als interaktive Anwendung arbeiten, ein Klick auf einen Button solleine Aktion auslösen.

Im Beispiel führen wir eine Zinseszins-Berechnung durch. Als Eingabedaten werden eineAnlagesumme in C, ein effektiver Jahreszins in % und ein Anlagezeitraum in Jahren angege-ben. Über einen Button wird die Berechnung der Auszahlungssumme angestoßen, diese wirddann angezeigt.

6.2 Reaktion auf Button: ex0201Im Gegensatz zu den vorangegangenen Formularen wird das dritte Formular nicht gedrucktsondern ausschließlich online benutzt. Als Papierformat wird deshalb nicht A4 benutzt son-dern 5.2057Zoll × 3.75Zoll (siehe Zeilen 8 und 9). Mit dem geometry-Package wird einRand von einem halben Zoll an den Seiten eingestellt.

Mit dem Package fancyhdr werden Kopf- und Fußzeile gestaltet, siehe Zeilen 12. . . 15.Das Formular soll – wenn es mehrseitig ist – seitenweise gescrollt werden („pdfpagelay-out=SinglePage“ in Zeile 18).

Da kein Ausdrucken vorgesehen ist, kann ein farbiger Hintergrund verwendet werden.Mit dem Argument

1 o n c l i c k ={ d o C a l c u l a t i o n ( ) }

wird eine JavaScript-Funktion vorgegeben, die beim Betätigen des Buttons ausgeführt wird.Hier wird kein Semikolon an den Funktionsaufruf angehangen.

Die Funktion doCalculation() liest die Werte aus den Eingabefeldern aus und nimmt eineBerechnung vor. Das Ergebis wird gerundet, auf zwei Nachkommastellen getrimmt, in einenString gewandelt und in einem Textfeld ausgegeben.

1 \ d o c u m e n t c l a s s { s c r a r t c l }2 \ s e t c o u n t e r { secnumdepth }{0}3 \ u s e p a c k a g e [ T1 ] { f o n t e n c }4 \ u s e p a c k a g e { tex tcomp }5 \ u s e p a c k a g e { mathptmx }6 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }7 \ u s e p a c k a g e { c o u r i e r }8 \ s e t l e n g t h { \ p a p e r w i d t h }{5 .2075 i n }9 \ s e t l e n g t h { \ p a p e r h e i g h t } { 3 . 7 5 i n }

10 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }11 \ u s e p a c k a g e [ p d f t e x , margin =0 .5 i n ] { geomet ry }12 \ u s e p a c k a g e { f a n c y h d r }13 \ l h e a d { Dicke Kohle GmbH} \ chead {}14 \ r h e a d { A b t e i l u n g f \ " { u} r Ver sp rechungen }15 \ l f o o t { } \ c f o o t { } \ r f o o t {}

51

16 \ p a g e s t y l e { f a n c y }17 \ u s e p a c k a g e { g r a p h i c x }18 \ u s e p a c k a g e { c o l o r }19 \ u s e p a c k a g e [ p d f t e x , p d f p a g e l a y o u t = S ing l ePage ,%20 p d f t i t l e ={ Anlagebe rechnung } , p d f s u b j e c t ={ Formula r}%21 ] { h y p e r r e f }22 \ d e f i n e c o l o r { background }{ rgb } { 0 . 9 9 , 0 . 9 8 , 0 . 8 5 }23 \ p a g e c o l o r { background }24 \ s e t l e n g t h { \ p a r i n d e n t } { 0 . 0cm}25 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }26 \ b e g i n { insDLJS } [ e xa a ca ] { e xa a ca }{ J a v a S c r i p t f u n c t i o n s }27 v a r done = 0 ;28

29 f u n c t i o n docOpen ( )30 {31 i f ( ! done ) {32 done = 1 ;33 v a r newco lo r = [ "RGB" , 0 . 9 9 , 0 . 9 8 , 0 . 8 5 ] ;34 v a r b o r c o l o r = [ "RGB" , 0 . 6 5 , 0 . 7 9 , 0 . 9 4 ]35 t h i s . g e t F i e l d ( " l 0 1 " ) . f i l l C o l o r = newco lo r ;36 t h i s . g e t F i e l d ( " l 0 1 " ) . s t r o k e C o l o r = newco lo r ;37 t h i s . g e t F i e l d ( " l 0 2 " ) . f i l l C o l o r = newco lo r ;38 t h i s . g e t F i e l d ( " l 0 2 " ) . s t r o k e C o l o r = newco lo r ;39 t h i s . g e t F i e l d ( " l 0 3 " ) . f i l l C o l o r = newco lo r ;40 t h i s . g e t F i e l d ( " l 0 3 " ) . s t r o k e C o l o r = newco lo r ;41 t h i s . g e t F i e l d ( " l 0 4 " ) . f i l l C o l o r = newco lo r ;42 t h i s . g e t F i e l d ( " l 0 4 " ) . s t r o k e C o l o r = newco lo r ;43 t h i s . g e t F i e l d ( " z e i t " ) . c u r r e n t V a l u e I n d i c e s = 0 ;44 t h i s . g e t F i e l d ( " z e i t " ) . f i l l C o l o r = newco lo r ;45 t h i s . g e t F i e l d ( " summe " ) . f i l l C o l o r = newco lo r ;46 t h i s . g e t F i e l d ( " z i n s " ) . f i l l C o l o r = newco lo r ;47 t h i s . g e t F i e l d ( " e r g e b n i s " ) . f i l l C o l o r = newco lo r ;48 }49 }50

51 f u n c t i o n d o C a l c u l a t i o n ( )52 {53 v a r summe = 0 . 0 + t h i s . g e t F i e l d ( " summe " ) . v a l u e ;54 v a r z i n s = 0 . 0 + t h i s . g e t F i e l d ( " z i n s " ) . v a l u e ;55 v a r z e i t = 0 + t h i s . g e t F i e l d ( " z e i t " ) . v a l u e ;56 v a r i , f a k t o r , we r t ;57 f a k t o r = 1 . 0 + 0 . 0 1 * z i n s ;58 f o r ( i = 0 ; i < z e i t ; i ++) {59 summe = summe * f a k t o r ;

52

60 }61 wer t = Math . round ( 1 0 0 . 0 * summe ) ;62 wer t = 0 . 0 1 * wer t ;63 wer t = wer t . t o F i x e d ( 2 ) ;64 wer t = wer t . t o S t r i n g ( ) ;65 t h i s . g e t F i e l d ( " e r g e b n i s " ) . v a l u e = wer t ;66 }67 \ end { insDLJS }68 \ OpenAction { / S / J a v a S c r i p t / JS ( docOpen ( ) ; ) }69 \ newcommand { \ t e x t f o r l a b e l }[2]{%70 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =9em , a l i g n =2,%71 b o r d e r c o l o r ={0 .99 0 . 9 8 0.85} ,%72 f i l l c o l o r ={0 .99 0 . 9 8 0 . 8 5 } , r e a d o n l y = t r u e ]{}%73 }74 \ b e g i n { document }75 \ b e g i n {Form}76 \ b e g i n { t a b u l a r } { | r l | }77 \ h l i n e78 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ] \ mu l t i co lumn { 2 } { | c |}{%79 \ t e x t s c {E \ , i \ , n \ , g \ , a \ , b \ , e \ , d \ , a \ , t \ , e \ , n}%80 } \ \81 &\\*[ −0.8em ] \ t e x t f o r l a b e l { l 0 1 }{ Anlagesumme :}&\ T e x t F i e l d [%82 name=summe , wid th =10em , b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}]{}%83 ~ \ t e x t e u r o \ \84 &\\*[ −0.8em ] \ t e x t f o r l a b e l { l 0 2 }{ Z i n s s a t z :}&\ T e x t F i e l d [%85 name= z i n s , wid th =10em , b o r d e r c o l o r ={0 .65 0 . 7 9 0 . 9 4 } ] { } ~ \ % \ \86 &\\*[ −0.8em ] \ t e x t f o r l a b e l { l 0 3 }{ A n l a g e z e i t r a u m :}&%87 \ ChoiceMenu [ name= z e i t , popdown= t r u e , b o r d e r c o l o r ={0 .65 0 . 7 9 0.94}%88 ]{}{{1}={1} ,{2}={2} ,{3}={3} ,{4}={4} ,{5}={5} ,%89 {6}={6} ,{7}={7} ,{8}={8} ,{9}={9} ,{10}={10}}~ J a h r e \ \90 &\\*[ −0.8em ] \ h l i n e91 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ]92 \ mu l t i co lumn { 2 } { | c | } { \ t e x t s c {B \ , e \ , r \ , e \ , c \ , h \ , n \ , u \ , n \ , g } } \ \93 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ]94 \ mu l t i co lumn { 2 } { | c | } { \ PushBut ton [ name= s t a r t ,%95 o n c l i c k ={ d o C a l c u l a t i o n ( ) } , b o r d e r c o l o r ={0 .65 0 . 7 9 0.94} ,%96 f i l l c o l o r ={0 .5 0 . 5 0 . 5 } ] { S t a r t } } \ \97 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ] \ h l i n e98 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ]99 \ mu l t i co lumn { 2 } { | c | } { \ t e x t s c {A\ , u \ , s \ , g \ , a \ , b \ , e } } \ \

100 \ mu l t i co lumn { 2 } { | c | } { } \ \ * [ − 0 . 8 em ] \ t e x t f o r l a b e l { l 0 4 }{%101 A n l a g e e r g e b n i s :}&\ T e x t F i e l d [ name= e r g e b n i s , w id th =10em,%102 b o r d e r c o l o r ={0 0 0} , r e a d o n l y = t r u e ] { } ~ \ t e x t e u r o \ \103 \ mu l t i co lumn { 2 } { | c | } { } \ \

53

104 \ h l i n e105 \ end { t a b u l a r }106 \ end {Form}107 \ end { document }

54

7 Formular Nummer vier: inputenc und insdljsDas Paket inputenc sorgt dafür, dass bestimmte Zeichen – z. B. deutsche Umlaute – in ent-sprechenden LATEX-Code umgewandelt werden. Diese Umwandlung ist im „normalen“ Textdurchaus gewünscht, im JavaScript-Code jedoch nicht.

Um die Umwandlung in JavaScript-Code zu verhindern, sollten die entsprechenden Zei-chen dort nicht direkt eingegeben werden sondern als ECMA-Script-Unicodezeichen. Einigeausgewählte Unicode-Codierungen sind in Tabelle 2 dargestellt.

Tabelle 2: JavaScript-Unicode für deutsche Umlaute

Zeichen JavaScript-Unicodeä \u00E4

ö \u00F6

ü \u00FC

A \u00C4

Ö \u00D6

Ü \u00DC

ß \u00DF

55

Hier ein Beispiel für die Verwendung von JavaScript-Unicode-Zeichen (Variable theText):

1 \ d o c u m e n t c l a s s [ ngerman , a 4 p a p e r ] { s c r a r t c l }2 \ u s e p a c k a g e [ l a t i n 1 ] { i n p u t e n c }3 \ u s e p a c k a g e { mathptmx }4 \ u s e p a c k a g e [ s c a l e d = . 9 2 ] { h e l v e t }5 \ u s e p a c k a g e { c o u r i e r }6 \ u s e p a c k a g e [ T1 ] { f o n t e n c }7 \ u s e p a c k a g e { tex tcomp }8 \ renewcommand * { \ f a m i l y d e f a u l t }{ phv }9 \ u s e p a c k a g e [ l e f t =25mm, t o p =25mm, bot tom =10mm, r i g h t =10mm] { geomet ry }

10 \ u s e p a c k a g e { f a n c y h d r }11 \ l h e a d { T e s t } \ chead { } \ r h e a d { i n p u t e n c und i n s d l j s }12 \ l f o o t { } \ c f o o t { } \ r f o o t {}13 \ p a g e s t y l e { f a n c y }14 \ u s e p a c k a g e { g r a p h i c x }15 \ u s e p a c k a g e { c o l o r }16 \ u s e p a c k a g e [17 p d f t e x , a 4 p a p e r = t r u e , c o l o r l i n k s = t r u e ,18 p d f t i t l e ={ i n s d l j s und i n p u t e n c } , p d f s u b j e c t ={ T e s t } ,19 p d f a u t h o r ={ i c h } ,20 pdfpagemode=UseNone , p d f s t a r t v i e w =FitH ,21 p a g e b a c k r e f , p d f h i g h l i g h t ={ /N}22 ] { h y p e r r e f }23 \ u s e p a c k a g e [ p d f t e x ] { i n s d l j s }24 \ b e g i n { insDLJS } [ exaada ] { exaada }{ J a v a S c r i p t a u f Document Leve l }25 / / i n d i c a t e t h a t t h e f u n c t i o n was n o t y e t run26 v a r done = 0 ;27

28 / / t e x t t o show when f i l e i s opened29 v a r t h e T e x t =30 " T e s t mi t \ u00E4 \ u00F6 \ u00FC \ u00C4 \ u00D6 \ u00DC \ u00DF " ;31

32 / / f u n c t i o n t o run when open ing t h e document33 f u n c t i o n m y F i r s t J a v a S c r i p t F u n c t i o n ( )34 {35 i f ( ! done ) {36 done = 1 ;37 app . a l e r t ( t h e T e x t ) ;38 }39 }40 \ end { insDLJS }41 \ OpenAction { / S / J a v a S c r i p t / JS ( m y F i r s t J a v a S c r i p t F u n c t i o n ( ) ; ) }42 \ newcommand { \ t e x t f o r l a b e l }[2]{%

56

43 \ T e x t F i e l d [ name ={#1} , v a l u e ={#2} , wid th =7em , a l i g n =2,%44 b o r d e r c o l o r ={1 1 1} , r e a d o n l y = t r u e ]{}%45 }46 \ b e g i n { document }47 \ s e c t i o n { T e s t mi t i n s d l j s und i n p u t e n c }48 Dies i s t e i n Tes t , ob e i n e Zusammenarbe i t d e r P a k e t e i n s d l j s49 und i n p u t e n c mögl ich i s t . \ \50 G e t e s t e t werden d i e d e u t s c h e n Umlaute und L i g a t u r e n51 \ b e g i n { i t e m i z e }52 \ i t em ä ( ae )53 \ i t em ö ( oe )54 \ i t em ü ( ue )55 \ i t em Ä ( Ae )56 \ i t em Ö ( Oe )57 \ i t em Ü ( Ue )58 \ i t em ß ( sz )59 \ end { i t e m i z e }60 \ end { document }

57

A Historie• Version 0.9.5 (07.02.2008)

zeigt in einem zusätzlichen Abschnitt, wie Online-Hilfe mit PDF-Annotationen (Noti-zen) oder mit Tooltips realisiert werden kann.

• Version 0.9.4 (20.06.2007)enthält einen zusätzlichen neuen Abschnitt, wie die Pakete insdljs und inputenc kombi-niert werden können. Dabei werden Sonderzeichen, die von inputenc umcodiert werden,nicht mehr direkt sondern als JavaScript-Unicode-Zeichen eingegeben.

• Version 0.9.3 (15.06.2007)enthält korrigierte Optionen für das Laden des hyperref-Packages.

1 pdfpagemode=UseNone

wurde ersetzt durch

1 pdfpagemode=UseNone

• Version 0.9.2 (14.06.2007)verwendet andere Fonts als die vorherigen Versionen. Die Präambel wurde von eineranderen Anleitung kopiert, die u. a. auch mathematische Sachverhalte darstellte und fürdiesen Zweck Mathematikfonts einband.Diese Mathematikfonts werden hier nicht benötigt.Gleichzeitig wird hier das Paket „pdfcprot“ anstelle des vorher genutzten Paketes „mi-crotype“ für den optischen Randausgleich genutzt.

• Version 0.9.1 (13.06.2007)enthält Korrekturen im Abschnitt „Schriftarten“. Fälschlicherweise wurde in Version0.9.0 behauptet,

1 \ u s e p a c k a g e [ T1 ] { f o n t e n c }

würde für die Verwendung von Type-1-Fonts sorgen. Dies stimmt nicht, die Anweisungbewirkt die Verwendung des T1-Font-Encoding-Vektors, wenn Type-1-Fonts benutztwerden.

• Version 0.9.0ist die erste auf CTAN veröffentlichte Version.Die englischsprachige Version wurde noch nicht korrekturgelesen, möglicherweise sindVerbesserungen hinsichtlich Ausdruck, Rechtschreibung und Grammatik erforderlich.

58

B GNU Free Documentation LicenseVersion 1.2, November 2002

Copyright © 2000,2001,2002 Free Software Foundation, Inc.59 Temple Place, Suite 330, Boston, MA 02111-1307 USAEveryone is permitted to copy and distribute verbatim copies of this license document, butchanging it is not allowed.

PREAMBLEThe purpose of this License is to make a manual, textbook, or other functional and usefuldocument “free” in the sense of freedom: to assure everyone the effective freedom to copyand redistribute it, with or without modifying it, either commercially or noncommercially.Secondarily, this License preserves for the author and publisher a way to get credit for theirwork, while not being considered responsible for modifications made by others.

This License is a kind of “copyleft”, which means that derivative works of the documentmust themselves be free in the same sense. It complements the GNU General Public License,which is a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because freesoftware needs free documentation: a free program should come with manuals providing thesame freedoms that the software does. But this License is not limited to software manuals; itcan be used for any textual work, regardless of subject matter or whether it is published as aprinted book. We recommend this License principally for works whose purpose is instructionor reference.

B.1 APPLICABILITY AND DEFINITIONSThis License applies to any manual or other work, in any medium, that contains a notice placedby the copyright holder saying it can be distributed under the terms of this License. Such anotice grants a world-wide, royalty-free license, unlimited in duration, to use that work underthe conditions stated herein. The “Document”, below, refers to any such manual or work. Anymember of the public is a licensee, and is addressed as “you”. You accept the license if youcopy, modify or distribute the work in a way requiring permission under copyright law.

A “Modified Version” of the Document means any work containing the Document or a porti-on of it, either copied verbatim, or with modifications and/or translated into another language.

A “Secondary Section” is a named appendix or a front-matter section of the Document thatdeals exclusively with the relationship of the publishers or authors of the Document to theDocument’s overall subject (or to related matters) and contains nothing that could fall directlywithin that overall subject. (Thus, if the Document is in part a textbook of mathematics, aSecondary Section may not explain any mathematics.) The relationship could be a matter ofhistorical connection with the subject or with related matters, or of legal, commercial, philoso-phical, ethical or political position regarding them.

59

The “Invariant Sections” are certain Secondary Sections whose titles are designated, asbeing those of Invariant Sections, in the notice that says that the Document is released underthis License. If a section does not fit the above definition of Secondary then it is not allo-wed to be designated as Invariant. The Document may contain zero Invariant Sections. If theDocument does not identify any Invariant Sections then there are none.

The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts orBack-Cover Texts, in the notice that says that the Document is released under this License. AFront-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A “Transparent” copy of the Document means a machine-readable copy, represented in aformat whose specification is available to the general public, that is suitable for revising thedocument straightforwardly with generic text editors or (for images composed of pixels) gene-ric paint programs or (for drawings) some widely available drawing editor, and that is suitablefor input to text formatters or for automatic translation to a variety of formats suitable for in-put to text formatters. A copy made in an otherwise Transparent file format whose markup, orabsence of markup, has been arranged to thwart or discourage subsequent modification by rea-ders is not Transparent. An image format is not Transparent if used for any substantial amountof text. A copy that is not “Transparent” is called “Opaque”.

Examples of suitable formats for Transparent copies include plain ASCII without markup,Texinfo input format, LATEX input format, SGML or XML using a publicly available DTD,and standard-conforming simple HTML, PostScript or PDF designed for human modification.Examples of transparent image formats include PNG, XCF and JPG. Opaque formats includeproprietary formats that can be read and edited only by proprietary word processors, SGML orXML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposesonly.

The “Title Page” means, for a printed book, the title page itself, plus such following pagesas are needed to hold, legibly, the material this License requires to appear in the title page. Forworks in formats which do not have any title page as such, “Title Page” means the text nearthe most prominent appearance of the work’s title, preceding the beginning of the body of thetext.

A section “Entitled XYZ” means a named subunit of the Document whose title either isprecisely XYZ or contains XYZ in parentheses following text that translates XYZ in anotherlanguage. (Here XYZ stands for a specific section name mentioned below, such as “Acknow-ledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of sucha section when you modify the Document means that it remains a section “Entitled XYZ”according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that thisLicense applies to the Document. These Warranty Disclaimers are considered to be includedby reference in this License, but only as regards disclaiming warranties: any other implicationthat these Warranty Disclaimers may have is void and has no effect on the meaning of thisLicense.

60

B.2 VERBATIM COPYINGYou may copy and distribute the Document in any medium, either commercially or noncom-mercially, provided that this License, the copyright notices, and the license notice saying thisLicense applies to the Document are reproduced in all copies, and that you add no other con-ditions whatsoever to those of this License. You may not use technical measures to obstructor control the reading or further copying of the copies you make or distribute. However, youmay accept compensation in exchange for copies. If you distribute a large enough number ofcopies you must also follow the conditions in section B.3.

You may also lend copies, under the same conditions stated above, and you may publiclydisplay copies.

B.3 COPYING IN QUANTITYIf you publish printed copies (or copies in media that commonly have printed covers) of theDocument, numbering more than 100, and the Document’s license notice requires Cover Texts,you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts:Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both coversmust also clearly and legibly identify you as the publisher of these copies. The front covermust present the full title with all words of the title equally prominent and visible. You mayadd other material on the covers in addition. Copying with changes limited to the covers, aslong as they preserve the title of the Document and satisfy these conditions, can be treated asverbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the firstones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacentpages.

If you publish or distribute Opaque copies of the Document numbering more than 100,you must either include a machine-readable Transparent copy along with each Opaque copy,or state in or with each Opaque copy a computer-network location from which the generalnetwork-using public has access to download using public-standard network protocols a com-plete Transparent copy of the Document, free of added material. If you use the latter option,you must take reasonably prudent steps, when you begin distribution of Opaque copies inquantity, to ensure that this Transparent copy will remain thus accessible at the stated locationuntil at least one year after the last time you distribute an Opaque copy (directly or throughyour agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before re-distributing any large number of copies, to give them a chance to provide you with an updatedversion of the Document.

B.4 MODIFICATIONSYou may copy and distribute a Modified Version of the Document under the conditions of sec-tions B.2 and B.3 above, provided that you release the Modified Version under precisely thisLicense, with the Modified Version filling the role of the Document, thus licensing distribution

61

and modification of the Modified Version to whoever possesses a copy of it. In addition, youmust do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document,and from those of previous versions (which should, if there were any, be listed in theHistory section of the Document). You may use the same title as a previous version ifthe original publisher of that version gives permission.

B. List on the Title Page, as authors, one or more persons or entities responsible for aut-horship of the modifications in the Modified Version, together with at least five of theprincipal authors of the Document (all of its principal authors, if it has fewer than five),unless they release you from this requirement.

C. State on the Title page the name of the publisher of the Modified Version, as the publis-her.

D. Preserve all the copyright notices of the Document.

E. Add an appropriate copyright notice for your modifications adjacent to the other copy-right notices.

F. Include, immediately after the copyright notices, a license notice giving the public per-mission to use the Modified Version under the terms of this License, in the form shownin the Addendum below.

G. Preserve in that license notice the full lists of Invariant Sections and required CoverTexts given in the Document’s license notice.

H. Include an unaltered copy of this License.

I. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating atleast the title, year, new authors, and publisher of the Modified Version as given on theTitle Page. If there is no section Entitled “History” in the Document, create one statingthe title, year, authors, and publisher of the Document as given on its Title Page, thenadd an item describing the Modified Version as stated in the previous sentence.

J. Preserve the network location, if any, given in the Document for public access to aTransparent copy of the Document, and likewise the network locations given in theDocument for previous versions it was based on. These may be placed in the “History”section. You may omit a network location for a work that was published at least fouryears before the Document itself, or if the original publisher of the version it refers togives permission.

K. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title ofthe section, and preserve in the section all the substance and tone of each of the contri-butor acknowledgements and/or dedications given therein.

62

L. Preserve all the Invariant Sections of the Document, unaltered in their text and in theirtitles. Section numbers or the equivalent are not considered part of the section titles.

M. Delete any section Entitled “Endorsements”. Such a section may not be included in theModified Version.

N. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in titlewith any Invariant Section.

O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify asSecondary Sections and contain no material copied from the Document, you may at youroption designate some or all of these sections as invariant. To do this, add their titles to thelist of Invariant Sections in the Modified Version’s license notice. These titles must be distinctfrom any other section titles.

You may add a section Entitled “Endorsements”, provided it contains nothing but endorse-ments of your Modified Version by various parties–for example, statements of peer review orthat the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Onlyone passage of Front-Cover Text and one of Back-Cover Text may be added by (or througharrangements made by) any one entity. If the Document already includes a cover text for thesame cover, previously added by you or by arrangement made by the same entity you areacting on behalf of, you may not add another; but you may replace the old one, on explicitpermission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission touse their names for publicity for or to assert or imply endorsement of any Modified Version.

B.5 COMBINING DOCUMENTSYou may combine the Document with other documents released under this License, under theterms defined in section B.4 above for modified versions, provided that you include in thecombination all of the Invariant Sections of all of the original documents, unmodified, andlist them all as Invariant Sections of your combined work in its license notice, and that youpreserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identicalInvariant Sections may be replaced with a single copy. If there are multiple Invariant Sectionswith the same name but different contents, make the title of each such section unique by addingat the end of it, in parentheses, the name of the original author or publisher of that section ifknown, or else a unique number. Make the same adjustment to the section titles in the list ofInvariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled “History” in the various origi-nal documents, forming one section Entitled “History”; likewise combine any sections Entitled“Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sectionsEntitled “Endorsements”.

63

B.6 COLLECTIONS OF DOCUMENTSYou may make a collection consisting of the Document and other documents released underthis License, and replace the individual copies of this License in the various documents with asingle copy that is included in the collection, provided that you follow the rules of this Licensefor verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individuallyunder this License, provided you insert a copy of this License into the extracted document,and follow this License in all other respects regarding verbatim copying of that document.

B.7 AGGREGATION WITH INDEPENDENT WORKSA compilation of the Document or its derivatives with other separate and independent docu-ments or works, in or on a volume of a storage or distribution medium, is called an “aggregate”if the copyright resulting from the compilation is not used to limit the legal rights of the com-pilation’s users beyond what the individual works permit. When the Document is included inan aggregate, this License does not apply to the other works in the aggregate which are notthemselves derivative works of the Document.

If the Cover Text requirement of section B.3 is applicable to these copies of the Document,then if the Document is less than one half of the entire aggregate, the Document’s Cover Textsmay be placed on covers that bracket the Document within the aggregate, or the electronicequivalent of covers if the Document is in electronic form. Otherwise they must appear onprinted covers that bracket the whole aggregate.

B.8 TRANSLATIONTranslation is considered a kind of modification, so you may distribute translations of the Do-cument under the terms of section B.4. Replacing Invariant Sections with translations requiresspecial permission from their copyright holders, but you may include translations of some orall Invariant Sections in addition to the original versions of these Invariant Sections. You mayinclude a translation of this License, and all the license notices in the Document, and any War-ranty Disclaimers, provided that you also include the original English version of this Licenseand the original versions of those notices and disclaimers. In case of a disagreement betweenthe translation and the original version of this License or a notice or disclaimer, the originalversion will prevail.

If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”,the requirement (section B.4) to Preserve its Title (section B.1) will typically require changingthe actual title.

B.9 TERMINATIONYou may not copy, modify, sublicense, or distribute the Document except as expressly pro-vided for under this License. Any other attempt to copy, modify, sublicense or distribute theDocument is void, and will automatically terminate your rights under this License. However,

64

parties who have received copies, or rights, from you under this License will not have theirlicenses terminated so long as such parties remain in full compliance.

B.10 FUTURE REVISIONS OF THIS LICENSEThe Free Software Foundation may publish new, revised versions of the GNU Free Do-cumentation License from time to time. Such new versions will be similar in spirit tothe present version, but may differ in detail to address new problems or concerns. Seehttp://www.gnu.org/copyleft/.

Each version of the License is given a distinguishing version number. If the Documentspecifies that a particular numbered version of this License “or any later version” applies to it,you have the option of following the terms and conditions either of that specified version or ofany later version that has been published (not as a draft) by the Free Software Foundation. Ifthe Document does not specify a version number of this License, you may choose any versionever published (not as a draft) by the Free Software Foundation.

ADDENDUM: How to use this License for your documentsTo use this License in a document you have written, include a copy of the License in thedocument and put the following copyright and license notices just after the title page:

Copyright © YEAR YOUR NAME. Permission is granted to copy, distribute an-d/or modify this document under the terms of the GNU Free Documentation Li-cense, Version 1.2 or any later version published by the Free Software Foundation;with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A co-py of the license is included in the section entitled “GNU Free DocumentationLicense”.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the“with...Texts.” line with this:

with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts beingLIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the three,merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasingthese examples in parallel under your choice of free software license, such as the GNU GeneralPublic License, to permit their use in free software.

65

Literatur[ADS05a] Adobe Developer Support. Acrobat JavaScript Scripting Guide. Adobe Systems

Incorporated, 2005.

[ADS05b] Adobe Developer Support. Acrobat JavaScript Scripting Reference. Adobe Sys-tems Incorporated, 2005.

[ASI01] Adobe Systems Incorporated. PDF Reference, third edition. Adobe Systems In-corporated, 2001.

[RO04] Sebastian Rahtz and Heiko Oberdiek. Hypertext marks in LaTeX: a manual forhyperref. 2004.

[Sup03] Adobe Technical Support. Acrobat JavaScript Object Specification Version 5.1.Adobe Systems Incorporated, 2003.

66