From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- .../pdfmark-drivers/icon-appr-eps-transp.tex | 79 +++++++++++++++++ .../examples/pdfmark-drivers/icon-appr-eps.tex | 84 +++++++++++++++++++ .../examples/pdfmark-drivers/icon-appr-pb.tex | 98 ++++++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps-transp.tex create mode 100644 macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps.tex create mode 100644 macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-pb.tex (limited to 'macros/latex/contrib/icon-appr/examples/pdfmark-drivers') diff --git a/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps-transp.tex b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps-transp.tex new file mode 100644 index 0000000000..d91a2e3396 --- /dev/null +++ b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps-transp.tex @@ -0,0 +1,79 @@ +\documentclass{article} + +\usepackage[designv,tight]{web} +\usepackage{eforms} +\usepackage{graphicxsp}[2018/11/20] +\usepackage{icon-appr}\previewOff + +\title{Creating icon appearances for button fields\texorpdfstring{\\[1ex]}{} using EPS methods with transparency} +\author{D. P. Story} +\university{Acro\TeX.Net} +\email{dpstory@acrotex.net} +\subject{Techniques for creating button appearances with transparency} +\keywords{icon appearances of push button,JavaScript} +\version{1.0} +\norevisionLabel + +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\begin{embedding} +\embedEPS[hiresbb,name=mani,transparencyGroup, + cipresp={[ /ca .3 /SetTransparency pdfmark}]{../graphics/man1} +\embedEPS[hiresbb,name=girl]{../graphics/girl} +\embedEPS[hiresbb,name=scot]{../graphics/scot} +\end{embedding} + +\begin{createImage}{\bboxOf{embedmani}}{manii} + [ {embedmani} /SP pdfmark +\end{createImage} + +\begin{document} + +\maketitle + +\section{Introduction} + +This document shows how to use transparency with the EPS method. It also shows how to use the same file +with 30\% opacity and 100\% opacity. \textsf{Adobe Distiller} is required as the PDF creator; the +\textsf{Distiller} settings must be set to \texttt{Standard\_transparency}, which ships with +\textsf{graphicxsp}. Instructions for installation of the \texttt{Standard\_transparency.joboptions} +file is presented in the documentation of the \textsf{graphicxsp} package. + +\section{Check box and radio buttons fields} + +The man icon has 30\% opacity in the checkbox and radio button fields below.\vcgBdry[6pt] + +Checkbox: +\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')\vcgBdry[6pt] + +Radio Button Fields: \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{Push button fields revisited} + +This push button uses the appearance referenced by \cs{manii}, which has 100\% opacity and was +declare in the \texttt{CreateIcon} environment, after embedding the icon files. \vcgBdry[6pt] + +\pushButton[% +% \A{\JS{app.alert("AcroTeX rocks!")}} + \TP{1}\BC{}\BG{}\S{S} + \I{\manii} + \RI{\girl} + \IX{\scot} +]{myButton}{50bp}{50bp} + + +\end{document} \ No newline at end of file diff --git a/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps.tex b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps.tex new file mode 100644 index 0000000000..3f864ba504 --- /dev/null +++ b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-eps.tex @@ -0,0 +1,84 @@ +\documentclass{article} + +\usepackage[designv,tight]{web} +\usepackage{eforms} +\usepackage{graphicxsp}[2018/11/20] +\usepackage{icon-appr}\previewOff + +\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} + +For 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} + + +\end{document} diff --git a/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-pb.tex b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-pb.tex new file mode 100644 index 0000000000..6c363c85b7 --- /dev/null +++ b/macros/latex/contrib/icon-appr/examples/pdfmark-drivers/icon-appr-pb.tex @@ -0,0 +1,98 @@ +\documentclass{article} +\usepackage[web={designv,tight},eforms +]{aeb_pro} +\usepackage{icon-appr}\previewOff +\usepackage{fancyvrb} + +\title{Creating icon appearances for push buttons\texorpdfstring{\\[1ex]}{} + using \textsf{aeb\_pro}} +\author{D. P. Story} +\university{Acro\TeX.Net} +\email{dpstory@acrotex.net} +\subject{Techniques for creating button appearances} +\keywords{icon appearances of push button,JavaScript} +\version{1.0} +\norevisionLabel + +\let\pkg\textsf +\let\app\textsf +\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}} +\newcommand{\cs}[1]{\texttt{\char`\\#1}} + +\begin{embedding} +\embedIcon[placement={Avatar1,[2]Avatar2}]{../graphics/man1.pdf} +\embedIcon[placement={[1]Avatar1,[1]Avatar2}]{../graphics/scot.gif} +\embedIcon[placement={[2]Avatar1,[0]Avatar2}]{../graphics/girl.png} +\end{embedding} + +\begin{document} + +\maketitle + +\section{Introduction} + +Here we use JavaScript methods for creating icon appearances for push buttons +(but not for check box or radio button fields). The technique requires +\app{aeb\_pro}. \app{Adobe Distiller} is needed to create the PDF (after +apply \app{dvips}), then open the newly created PDF in the full \app{Acrobat} +application and save the document. + +You can use purely EPS files as well that do not use JavaScript methods and +does not require \pkg{aeb\_pro}; however, \pkg{graphicxsp} is required +instead. Refer to \texttt{icons-appr-eps.tex}.\medskip + +\noindent\textbf{The premise.} We have two fields we want to supply icon +appearances to; these are \texttt{Avatar1} and \texttt{Avatar2}. In the +preamble of this document, we have, +\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small] +\begin{embedding} +\embedIcon[placement={Avatar1,[2]Avatar2}]{../graphics/man1.pdf} +\embedIcon[placement={[1]Avatar1,[1]Avatar2}]{../graphics/scot.gif} +\embedIcon[placement={[2]Avatar1,[0]Avatar2}]{../graphics/girl.png} +\begin{embedding} +\end{Verbatim} +The required argument is the path to the image file. For this situation, for +the optional argument, there are two keys of interest, \texttt{placement} and +\texttt{page}, the latter applies to a PDF image file. The value of +\texttt{page} is a base~0 page number (the first page is page~0). + +The \texttt{placement} key ``places'' the image on the button faces of the +field names listed (\texttt{Avatar1} and \texttt{Avatar2}). There is an +optional argument that precedes the field name that determines the face of +the button the icon is to appear on; the values are \texttt{[0]} (default, +normal icon); \texttt{[1]} (down icon); and \texttt{[2]} (rollover icon). The +optional argument precedes the field name, and is shown in the example above. +There must be no space between the optional argument and the field name; if +you type `\texttt{[2]\hardspace Avatar1}', for example, the field name is interpreted +as `\texttt{\hardspace Avatar1}', which is incorrect. The example is shown below.\medskip + +\def\myPresets{\BC{}\BG{}\S{S}\autoCenter{n}\importIcons{y} + \FB{true}\TP{1}} + +\hspace*{20pt}\pushButton[\presets{\myPresets}\A{\JS{app.alert("Avatar 1")}}]{Avatar1}{.5in}{.5in}\qquad +\pushButton[\presets{\myPresets}\A{\JS{app.alert("Avatar 2")}}]{Avatar2}{.5in}{.5in}\medskip + +\noindent The verbatim listing of the above push buttons with custom appearance follows: +\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small] +\def\myPresets{\BC{}\BG{}\S{S}\autoCenter{n} + \FB{true}\importIcons{y}\TP{1}} +\pushButton[\presets{\myPresets} + \A{\JS{app.alert("Avatar 1")}}]{Avatar1}{.5in}{.5in}\qquad +\pushButton[\presets{\myPresets} + \A{\JS{app.alert("Avatar 2")}}]{Avatar2}{.5in}{.5in} +\end{Verbatim} +Note that I've inserted a \cs{presets} key with value of \cs{myPresets}, to +conveniently enter standard optional parameters. The meaning of \cs{FB} and +\cs{TP} are explained in the \pkg{icon-appr} package documentation. An +important key-value is \cs{importIcons}, we set its value as +\verb!\importIcons{y}!; this declares that the push button field is the +target of some JavaScript that will supply the icon appearances. + +\section{Check box and radio buttons fields} + +We use JavaScript methods to populate the appearance faces of push buttons; +however, there are no JavaScript methods for populating appearance faces for +check boxes and radio button fields. Other methods need to be used; these are +methods demonstrated in \texttt{icons-appr-eps.tex}. + +\end{document} -- cgit v1.2.3