summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/icon-appr/examples/pdfmark-drivers/icon-appr-eps.tex
blob: 5249486424e5782016d27fa5de0b39391c3824bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
\documentclass{article}
\usepackage[designv,tight]{web}
\usepackage{eforms}
\usepackage{graphicxsp}[2018/11/20]
\usepackage{icon-appr}

%\previewOn\pmpvOn

\title{Creating icon appearances for button fields\texorpdfstring{\\[1ex]}{ }using EPS methods}
\author{D. P. Story}
\university{Acro\TeX.Net}
\email{dpstory@acrotex.net}
\subject{Techniques for creating icon appearances for button fields}
\keywords{icon appearances of button fields}
\version{1.0}
\norevisionLabel

\newcommand{\cs}[1]{\texttt{\char`\\#1}}

\begin{embedding}
\embedEPS[hiresbb,name=mani]{../graphics/man1}
\embedEPS[hiresbb,name=girl]{../graphics/girl}
\embedEPS[hiresbb,name=scot]{../graphics/scot}
\end{embedding}

\begin{document}

\maketitle

\section{Introduction}

Forxx the \textsf{\textbf{pdfmark}}-type drivers (\textsf{dvips} and
\textsf{dvipsone}), there are two ways to create an icon appearance: (1)
JavaScript methods and (2) EPS methods. The JavaScript methods are
demonstrated in \texttt{icons-appr-pb.tex}. A shortcoming of the JavaScript
method is that \textsf{Acrobat} and \textsf{Distiller}) are needed, and the
methods do not apply to check box and radio button fields. The advantage of
EPS methods is they apply to all button fields.


\section{Push button fields}

\noindent\begin{minipage}[t]{100bp}\kern0pt
\pushButton[\BC{}\BG{}\autoCenter{n}
%  \A{\JS{app.alert("AcroTeX rocks!")}}
  \TP{1}\BG{}\S{S}
  \I{\mani}
  \RI{\girl}
  \IX{\scot}
]{myButton}{100bp}{100bp}
\end{minipage}\cgBdry[6bp]\raisebox{-.5\baselineskip}{\begin{minipage}[t]{\linewidth-108bp}
\textbf{Comments on PDF creation.} The file can be distilled and viewed in
\textsf{Acrobat} and saved for others to view in another PDF viewer; however,
you can also use \textsf{ps2pdf} to produce a PDF file; however, the
resulting PDF does not display correctly in \textsf{PDF-XChange Editor} (or
\textsf{Viewer}). In this case, open the file in \textsf{Adobe Reader DC} (or
\textsf{Acrobat}) and save it. It will now view correctly in
\textsf{PDF-XChange}. This file does view correctly for \textsf{SumatraPDF};
however, the buttons have the correct appearances, but are not functional.
\end{minipage}}

\section{A check box button field}

\checkBox[\BC{}\BG{}
    \V{Off}\DV{Off}\AS{Off}\H{N}\autoCenter{y}
    \AP{\N{\On{Man}{\mani} \Off{\girl}}}
    ]{myCkBx}{22bp}{22bp}{Man}\quad(Girl is `off', Man is `on')\hfill
\pushButton[\CA{Reset}\A{\JS{this.resetForm();}}]{reset}{}{11bp}

\section{A radio button field}

\radioButton[\BC{}\BG{}
    \V{Off}\DV{Off}\AS{Off}\H{N}\autoCenter{y}
    \AP{\N{\On{Man}{\mani} \Off{\girl}}}
    ]{myRadBtn}{22bp}{22bp}{Man}\quad \radioButton[\BC{}\BG{}
    \V{Off}\DV{Off}\AS{Off}\H{N}\autoCenter{y}
    \AP{\N{\On{Man}{\mani} \Off{\girl}}}
    ]{myRadBtn}{22bp}{22bp}{Man}\quad\radioButton[\BC{}\BG{}
    \V{Off}\DV{Off}\AS{Off}\H{N}\autoCenter{y}
    \AP{\N{\On{Man}{\mani} \Off{\girl}}}
    ]{myRadBtn}{22bp}{22bp}{Man}\quad(Girl is `off', Man is `on')\hfill
\pushButton[\CA{Reset}\A{\JS{this.resetForm();}}]{reset}{}{11bp}


\section{Icons in this document}

Use the button below to cycle through all icons in this document.

% Note, compare this code and fields with that of icon-appr-exmpl.tex
% in the latter file, we include a caption, where here, we do not
% include a caption.
\begin{defineJS}{\cycleJS}
if (typeof indexIcon == "undefined") var indexIcon=0;
var oIconName=this.icons[indexIcon].name;
var f=this.getField("iconContainer");
var oIcon=this.getIcon(oIconName);
f.buttonSetIcon(oIcon);
indexIcon = (indexIcon+1) \% (this.icons.length);
\end{defineJS}

\begin{center}
\pushButton[\BG{}\autoCenter{n}
  \TP{1}\I{}\S{S}]{iconContainer}{100bp}{100bp}\vcgBdry[6bp]
\pushButton[\CA{Cycle}\AAmouseup{\cycleJS}]{cycleBtn}{}{11bp}
\end{center}

\end{document}