diff options
author | Norbert Preining <norbert@preining.info> | 2017-07-13 10:25:48 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2017-07-13 10:25:48 +0900 |
commit | cfe306ba1b7ec40855a300580b7981845d56edeb (patch) | |
tree | e2feaf2adf8a8afe43a995528097913793874d01 /texmf-dist/source | |
parent | 32d0671418a3cc6ad0465b06539ed54d96f77784 (diff) |
add aeb-mlink aeb-pro aebxmp graphicxsp annot-pro
Diffstat (limited to 'texmf-dist/source')
28 files changed, 15102 insertions, 0 deletions
diff --git a/texmf-dist/source/latex/aeb-mlink/aeb_mlink.dtx b/texmf-dist/source/latex/aeb-mlink/aeb_mlink.dtx new file mode 100644 index 00000000..c4c7b7be --- /dev/null +++ b/texmf-dist/source/latex/aeb-mlink/aeb_mlink.dtx @@ -0,0 +1,624 @@ +% \iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aeb_mlink.sty package, 2015-10-28 %% +%% Copyright (C) 2006--2015 D. P. Story %% +%% dpstory@acrotex.net %% +%% storyd@owc.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesPackage{aeb_mlink} +%<package> [2016/02/16 v2.0 AeB MLink (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +\pdfstringdefDisableCommands{\let\\\textbackslash}% +\EnableCrossrefs \CodelineIndex +\OnlyDescription % comment out for implementation details +\begin{document} + \GetFileInfo{aeb_mlink.sty} + \title{The \textsf{aeb\_mlink} Package\texorpdfstring{\\}{: } + A member of the AeB Pro family} + \author{D. P. Story\\ + Email: \texttt{storyd@owc.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{aeb_mlink.dtx} + \PrintIndex +\end{document} +%</driver> +% \fi +% \section{Introduction} +% This package creates \underbar{m}ultiline-\underbar{links}. +% The package \textsf{hyperref} does create links, but generally +% these links cannot be broken across lines, unless \textsf{pdflatex} +% is used to create a PDF. +% +% This package uses the \texttt{QuadPoints} entry in the link annotation to create +% a bounding region; consequently, this package requires \textbf{Acrobat Distiller} +% to create a PDF. \texttt{QuadPoints} is a PDF 1.6 feature, so these multiline links +% will work in Adobe Reader 7.0 or later. If viewed in a version of Adobe Reader previous +% to 7.0, the viewer will use the underlying bounding box. +% +% LaTeX package requirements are the \textsf{eForms} and \textsf{hyperref}. Only the use +% of \textsf{dvips} and \textsf{dvipsone} is supported. +% +%The key to creating a multi-line is contained in Table~8.24 of the +%PDF Reference. The description of \texttt{QuadPoints} in the PDF Reference +%is as follows: +% +%\begin{quote}\small +%(Optional; PDF 1.6) An array of $8 \times n$ numbers specifying the +%coordinates of $n$ quadrilaterals in default user space that comprise +%the region in which the link should be activated. The coordinates +%for each quadrilateral are given in the order +%$$ +% x_1\ y_1\ x_2\ y_2\ x_3\ y_3\ x_4\ y_4 +%$$ +%specifying the four vertices of the quadrilateral in +%counterclockwise order. For orientation purposes, such as when +%applying an underline border style, the bottom of a quadrilateral is +%the line formed by $(x_1 , y_1)$ and $(x_2 , y_2)$. If this entry is not +%present or the viewer application does not recognize it, the region +%specified by the \texttt{Rect} entry should be used. \texttt{QuadPoints} should be +%ignored if any coordinate in the array lies outside the region +%specified by \texttt{Rect}. +%\end{quote} +% \begin{macrocode} +%<*package> +% \end{macrocode} +% \begin{macrocode} +\RequirePackage{ifpdf}[2006/02/20] +\RequirePackage{ifxetex}[2006/08/21] +\newif\if@ml@dvips \@ml@dvipstrue +% \end{macrocode} +% \begin{macro}{dvipsone} +% Set the driver for \texttt{dvipsone} +% \begin{macrocode} +\DeclareOption{dvipsone}{\def\eq@drivernum{0}\@ml@dvipsfalse + \PassOptionsToPackage{dvipsone}{eforms} + \PassOptionsToPackage{dvipsone}{hyperref} %,colorlinks +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{dvips} +% Set the driver for \texttt{dvips} +% \begin{macrocode} +\DeclareOption{dvips}{\def\eq@drivernum{0}\@ml@dvipstrue + \PassOptionsToPackage{dvips}{eforms} + \PassOptionsToPackage{dvips}{hyperref} %,colorlinks +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\ml@err@msg{This package requires the driver dvips and\MessageBreak + Adobe Distiller as the PDF creator} +\ifpdf\PackageError{aeb_mlink}{\ml@err@msg}\else + \ifxetex\PackageError{aeb_mlink}{\ml@err@msg}\else + \InputIfFileExists{web.cfg}{}{} +\fi\fi +\ProcessOptions +% \end{macrocode} +% We require hyperref, eforms and soul. For eforms, a recent version is needed, +% \texttt{2008/03/14} or later. +% \begin{macrocode} +\RequirePackage{hyperref} +\RequirePackage{eforms}[2008/03/14] +\RequirePackage{soul} +% \end{macrocode} +% +% \section{Driver Dependent Code} +% +% Driver dependent definitions for dvipsone and dvips. +% \begin{macrocode} +\def\ps@mark{[\space} +\if@ml@dvips +% \end{macrocode} +% This next \cs{special} defines some standard conversion +% formulas, {\TeX} to PDF and PDF to {\TeX} for \textsf{dvips}. +% \begin{macrocode} +\special{!userdict begin + /TeXtoPDF {65536 div DVImag mul} def % sp to pts + /PDFtoDvips {72.27 div Resolution mul} def % points to dots + /PDFtoVDvips {72.27 div VResolution mul} def % points to dots + /DvipstoPDF {72.27 mul Resolution div} def % dots to points + /HTeXtoDvips {TeXtoPDF PDFtoDvips} def % sp to dots + /VTeXtoDvips {TeXtoPDF PDFtoVDvips} def end} % sp to dots +% \end{macrocode} +% This command calculates the \cs{QuadPoints} array +% when we are using the \textsf{dvips} driver. +% \begin{macrocode} +\def\setQuadBox{% + currentpoint DvipstoPDF \aeb@bbox@dp\space TeXtoPDF add + neg vsize add 72 sub % y1 + exch DvipstoPDF 72 add exch % x1 + 2 copy exch \aeb@bbox@wd\space TeXtoPDF add exch % x2 + 2 copy \aeb@bbox@ht\space TeXtoPDF add % y3 + 2 copy exch \aeb@bbox@wd\space TeXtoPDF sub exch % x4 +} +% \end{macrocode} +% For the bounding rectangle, we just enclose the entire page. This +% simplifies things greatly. +% \begin{macrocode} +\def\par@@Rect +{% + 72 neg PDFtoDvips vsize 72 sub PDFtoVDvips + hsize 72 sub PDFtoDvips 72 neg PDFtoVDvips +} +% \end{macrocode} +% This next \cs{special} defines some standard conversion +% formulas, {\TeX} to PDF and PDF to {\TeX} in the YandY TeX System. +% \begin{macrocode} +\else +\special{!/TeXtoPDF {65536 div mag 1000 div mul} def +/PDFtoTeX {65536 mul mag 1000 div div} def} +% \end{macrocode} +% This command calculates the \cs{QuadPoints} array +% when we are using the \textsf{dvipsone} driver. +% \begin{macrocode} +\def\setQuadBox{% + currentpoint \aeb@bbox@dp\space add TeXtoPDF + neg PageHeight add 72 sub % y1 + exch TeXtoPDF 72 add exch % x1 + 2 copy exch \aeb@bbox@wd\space TeXtoPDF add exch % x2 + 2 copy \aeb@bbox@ht\space TeXtoPDF add % y3 + 2 copy exch \aeb@bbox@wd\space TeXtoPDF sub exch % x4 +} +% \end{macrocode} +% For the bounding rectangle, we just enclose the entire page. This +% simplifies things greatly. +% \begin{macrocode} +\def\par@@Rect +{% + 72 neg PDFtoTeX PageHeight 72 sub PDFtoTeX + PageWidth 72 sub PDFtoTeX 72 neg PDFtoTeX +} +\fi +% \end{macrocode} +% +% \section{The Multi-line Linking Commands} +% +% We use a box, and two counters for this package. +% \begin{macrocode} +\newbox\aeb@bbox +\newcount\aeb@arrayIndx \aeb@arrayIndx=0 +\newcount\aeb@mLinkCnt \aeb@mLinkCnt=0 +% \end{macrocode} +% \begin{macro}{\mlhypertext} +% +% This is a general purpose hypertext link. Not only is it +% a fine stand-alone linking command, but it also serves +% as a building block to some convenience commends that follow. +% +% The commands takes two arguments, the first an optional one the second +% one requires. +% \begin{enumerate} +% \item[\texttt{[\#1]}] A standard optional argument for eForms, to change +% the appearance of the link and/or to include actions. +% \item[\texttt{\#2}] The text to be enclosed in a link. +% \end{enumerate} +% \begin{macrocode} +\def\CurrentBorderColor{\@linkbordercolor} +\def\ml@nocolorHighlight{I} +\def\ml@nocolorLineStyle{S} +\def\ml@nocolorLineWidth{1} +\def\ml@setnocolorDefaults{% +\def\ml@nocolor@defaults{\H{\ml@nocolorHighlight}% + \S{\ml@nocolorLineStyle}\W{\ml@nocolorLineWidth}% + \Color{\CurrentBorderColor}}% +} +\ifHy@colorlinks + \let\ml@nocolor@defaults\@empty +\else + \ml@setnocolorDefaults +\fi +\def\ml@earlyExecProps#1{% + \eq@setWidgetProps\relax{#1}% +} +\let\mlh@preambleCmdInsert\relax +\newcommand{\mlhypertext}[1][]{\global\aeb@arrayIndx=0\relax + \global\advance\aeb@mLinkCnt1\relax +% \end{macrocode} +% We do something different, we process the options early, mostly +% to get any change in \texttt{linktxtcolor}, but only if the user-friendly \texttt{ui} is +% present. +% \begin{macrocode} + \special{ps: \ps@mark/_objdef {mLink\the\aeb@mLinkCnt} + /type /array /OBJ pdfmark}% + \def\mlh@preambleCmdInsert{\ml@earlyExecProps{#1}}% + \def\mlh@postambleCmd{\setLinkPbox{\S{S}\W{0}% + \presets{\ml@nocolor@defaults}% + \QuadPoints{mLink\the\aeb@mLinkCnt}#1}\endgroup}% + \aeb@mlh +} +\def\mlh@setQuadSyllable#1{% + \setbox\aeb@bbox=\hbox{\strut#1}% + {% + \count\z@=\ht\aeb@bbox\xdef\aeb@bbox@ht{\the\count\z@}% + \count\z@=\wd\aeb@bbox\xdef\aeb@bbox@wd{\the\count\z@}% + \dp\aeb@bbox=1pt\relax + \count\z@=\dp\aeb@bbox\xdef\aeb@bbox@dp{\the\count\z@}% + }% + \special{ps: \ps@mark{mLink\the\aeb@mLinkCnt} + \the\aeb@arrayIndx\space [\setQuadBox] + \space /PUTINTERVAL pdfmark}% + \global\advance\aeb@arrayIndx8\relax +} +% \end{macrocode} +% \end{macro} +% The next four commands are used internally, though \cs{aebnameref}, +% \cs{labelRef} and \cs{atPage} are public, and can be used. +% \begin{macrocode} +\def\aeb@exiii{\expandafter\expandafter\expandafter} +\def\aebnameref#1{\@ifundefined{r@#1}{??} + {\aeb@exiii\@thirdoffive\csname r@#1\endcsname}} +\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start} + {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}} +\def\atPage#1{\@ifundefined{r@#1}{1} + {\aeb@exiii\@secondoffive\csname r@#1\endcsname}} +% \end{macrocode} +% \begin{macro}{\mlhyperlink} +% \begin{macro}{\mlhyperref} +% \begin{macro}{\mlnameref} +% \begin{macro}{\mlNameref} +% These four commands mimic the hyperref commands of the same root name. +% The commands \cs{mlhyperlink} and \cs{mlhyperref} take three +% parameters (the first one optional). The optional parameter +% modifies the appearance of the link, the second is the +% target/destination of the link, the third is the text the link is +% wrapped around. In the case of \cs{mlhyperlink} that target is a +% defined by \cs{hypertarget}; for \cs{mlhyperref} the target is a +% latex label. +% +% The commands \cs{mlnameref} and \cs{mlNameref} take two parameters +% (the first is optional). As before, the first modifies the +% appearance of the link, the second is the target, a latex label. +% \begin{macrocode} +\newcommand\mlhyperlink[3][]{% + \mlhypertext[#1\A{/S/GoTo/D (#2)}]{#3}} +\newcommand\mlhyperref[3][]{% + \mlhypertext[#1\A{/S/GoTo/D (\labelRef{#2})}]{#3}} +\newcommand\mlnameref[2][]{\protected@edef\ml@temp{\aebnameref{#2}}% + \def\ml@tempi{\mlhypertext[#1\A{/S/GoTo/D (\labelRef{#2})}]}% + \expandafter\ml@tempi\expandafter{\ml@temp}} +% \end{macrocode} +% We use a work around to a |\relax| problem encountered in the +% |\mlNameRef| command. {\LaTeX} inserts a |relax| at the end of label +% titles, which stops soul. We insert |\let\SOUL@stop\ml@SOUL@stop|, +% this seems to work, no guarantees. +% \begin{macrocode} +\newcommand\mlNameref[2][]{\let\SOUL@stop\ml@SOUL@stop + \protected@edef\ml@temp{`\aebnameref{#2}' on page~\atPage{#2}}% + \def\ml@tempi{\mlhypertext[#1\A{/S/GoTo/D (\labelRef{#2})}]}% + \expandafter\ml@tempi\expandafter{\ml@temp}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\mlhref} +% This command is similar to \cs{href}. This command also takes +% three arguments, one optional. The first is usual optional argument +% that allow one to modify the appearance of the link, the second one +% is the URL that we are linking to, the third is the text that we are +% wrapping this link around. +% +% The next three commands are modifications some low hyperref commands +% found in the \texttt{pdfmark.def} file. Depending on the parsing, +% \cs{href} calls one of these three; we intercept them, and insert +% our own command \cs{mlhypertext} so the link string gets wrapped around +% if needed. +% \begin{macrocode} +\def\ml@hyper@linkurl#1#2{\hyper@chars + \let\ef@thislinkcolor\@urlcolor + \let\CurrentBorderColor\@urlbordercolor + \mlhypertext[\presets{\mlhref@args}\A{/S/URI/URI(#2)}]{#1}% + \endgroup +}% +\def\ml@hyper@linkfile#1#2#3{% + \let\ef@thislinkcolor\@filecolor + \let\CurrentBorderColor\@filebordercolor + \def\theView{[0 \@pdfstartview]}% + \@ifundefined{ifHy@pdfnewwindow} + {\ifHy@newwindow}{\ifHy@pdfnewwindow}% + \def\isWindow{/NewWindow true}\else + \let\isWindow\@empty\fi + \mlhypertext[\presets{\mlhref@args}\A{/S/GoToR \isWindow + /F (#2) /D \ifx\\#3\\\theView\else(#3)\fi}]{#1}% + \endgroup +} +\def\ml@hyper@launch run:#1\\#2#3{% + \let\ef@thislinkcolor\@filecolor + \let\CurrentBorderColor\@runbordercolor + \@ifundefined{ifHy@pdfnewwindow} + {\ifHy@newwindow}{\ifHy@pdfnewwindow}% + \def\isWindow{/NewWindow true}\else + \let\isWindow\@empty\fi + \mlhypertext[\presets{\mlhref@args}\A{/S/Launch\isWindow + /F (#1) \ifx\\#3\\\else /Win << /P (#3) /F (#1) >> \fi}]{#2}% + \endgroup +} +% \end{macrocode} +% Below is the code for \cs{mlhref}. We first let the old commands found in \texttt{pdfmark.def} +% equal to the new versions, then we call \cs{href} to do all the parsing. Things +% eventually comes back to the above three commands. +% \begin{macrocode} +\let\aeb@saved@href\href +\newcommand{\mlhref}[1][]{% + \begingroup + \def\mlhref@args{#1}% + \let\hyper@linkurl\ml@hyper@linkurl + \let\hyper@linkfile\ml@hyper@linkfile + \let\@hyper@launch\ml@hyper@launch + \aeb@saved@href +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\mlurl} +% The multi-line version of Donald Arseneau's url package. There +% are problems with this one, will continue to work on it. +% \changes{v2.0}{2016/02/16}{Added support for the \cs{url} command.} +% +% The problem is not as ``easy'' as the previous cases. Arseneau places the URL in math mode +% and it does not reconstruct (\texttt{soul} terminology) as it should. Our solution is to +% hijack three commands of \texttt{soul} \cs{SOUL@doword}, \cs{SOUL@analyze}, and \cs{SOUL@dosyllable}, +% and modify them to do the work on an URL. +% \begin{macrocode} +\newbox\ml@urlbuild +\setbox\ml@urlbuild\hbox{} +% \end{macrocode} +% We modify \cs{SOUL@doword} and name it \cs{ml@SOUL@doword}. +% \begin{macrocode} +\def\ml@SOUL@doword{% + \global\setbox\ml@urlbuild\hbox{}% + \edef\x{\the\SOUL@word}% + \ifx\x\empty + \else + \SOUL@buffer={}% + \setbox\z@\vbox{% + \SOUL@tt + \hyphenchar\font`\- + \hfuzz\maxdimen + \hbadness\@M + \pretolerance\m@ne + \tolerance\@M + \leftskip\z@ + \rightskip\z@ + \hsize1sp + \everypar{}% + \parfillskip\z@\@plus1fil + \hyphenpenalty-\@M + \noindent + \hskip\z@ + \relax + \the\SOUL@word}% +% \end{macrocode} +% We don't do the reconstruction, so no need for the message. +% \begin{macrocode} + \let\SOUL@errmsg\relax +% \let\SOUL@errmsg\SOUL@error + \let\-\relax + \count@\m@ne +% \end{macrocode} +% Here is the first major change, rather than splitting off to \cs{SOUL@analyze}, we go +% to our modified version, \cs{ml@SOUL@analyze}. +% \begin{macrocode} + \ml@SOUL@analyze + \SOUL@word={}% + \fi +} +% \end{macrocode} +% We modify \cs{SOUL@analyze} and name it \cs{ml@SOUL@analyze}. +% \begin{macrocode} +\def\ml@SOUL@analyze{{% + \setbox\z@\vbox{% + \unvcopy\z@ + \unskip + \unpenalty + \global\setbox\@ne=\lastbox}% + \ifvoid\@ne + \else + \setbox\@ne\hbox{\unhbox\@ne}% +% \end{macrocode} +% If we say \verb!\mlurl{http://www.math.uakron.edu/~dpstory}!, then the \cs{box\cs{z@}} above contains +% the following tokens, listed at their breakpoints:\goodbreak +% \begin{flushleft} +% \texttt{http:}\\ +% \texttt{\string\\}\\ +% \texttt{www.}\\ +% \texttt{math.}\\ +% \texttt{uakron.}\\ +% \texttt{edu/}\\ +% \texttt{\string~dpstory} +% \end{flushleft} +% The idea is to get each of these using \verb~\global\setbox\@ne=\lastbox~ (bottom to top) +% and to build the URL with the quad points calculated. Each new token is added in front +% of the URL as we build it. Results are held in \cs{ml@urlbuild}. We insert \cs{penalty0} to +% promote a break point between components, as each component is enclosed in an \cs{hbox} now. +% \begin{macrocode} + \global\setbox\ml@urlbuild=\hbox{% + \mlh@setQuadSyllable{\unhcopy\@ne}% + \hbox{\unhcopy\@ne}\penalty0\unhcopy\ml@urlbuild}% + \SOUL@syllgoal=\wd\@ne + \advance\count@\@ne +% \end{macrocode} +% We get the tokens recursively, be we jump back to \cs{ml@SOUL@analyze} not +% \cs{SOUL@analyze}. +% \begin{macrocode} + \ml@SOUL@analyze + \SOUL@syllwidth\z@ + \SOUL@syllable={}% + \ifnum\count@>\z@ + \advance\SOUL@syllgoal-\SOUL@ttwidth +% \end{macrocode} +% At this point, we jump to \cs{ml@SOUL@dosyllable} rather than +% \cs{SOUL@dosyllable}. +% \begin{macrocode} + \ml@SOUL@dosyllable + \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}% + {\SOUL@sethyphenchar}% + \SOUL@everyhyphen + \else +% \end{macrocode} +% Use \cs{ml@SOUL@dosyllable} not \cs{SOUL@dosyllable}. +% \begin{macrocode} + \ml@SOUL@dosyllable + \fi + \fi +}} +% \end{macrocode} +% We modify \cs{SOUL@dosyllable} and name it \cs{ml@SOUL@dosyllable}. +% \begin{macrocode} +\def\ml@SOUL@dosyllable{% + \SOUL@gettoken + \SOUL@eventuallyexhyphen{\the\SOUL@token}% + \edef\x{\the\SOUL@token}% + \ifx\x\SOUL@hyphenhintM + \let\SOUL@n\ml@SOUL@dosyllable + \else\ifx\x\SOUL@lowerthanM + \SOUL@gettoken + \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern} + {\the\SOUL@token}% + \SOUL@everylowerthan + \SOUL@puttoken + \let\SOUL@n\ml@SOUL@dosyllable + \else\ifdim\SOUL@syllwidth=\SOUL@syllgoal + \SOUL@everysyllable + \SOUL@puttoken + \let\SOUL@n\relax + \else + \ifx\x\SOUL@stopM + \SOUL@errmsg + \global\let\SOUL@errmsg\relax + \let\SOUL@n\relax + \else + \setbox\tw@\hbox{\SOUL@tt\the\SOUL@token}% + \advance\SOUL@syllwidth\wd\tw@ + \global\SOUL@lasttoken=\SOUL@token + \SOUL@gettoken + \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern} + {\the\SOUL@token}% + \SOUL@puttoken + \global\SOUL@token=\SOUL@lasttoken + \SOUL@everytoken + \edef\x{\SOUL@syllable={\the\SOUL@syllable\the\SOUL@token}}\x +% \end{macrocode} +% Here is the only change, we direct flow back to \cs{ml@SOUL@dosyllable} +% \begin{macrocode} + \let\SOUL@n\ml@SOUL@dosyllable + \fi\fi\fi\fi + \SOUL@n +} +% \end{macrocode} +% After the above preliminaries, we finally define \DescribeMacro{\mlurl}\cmd{\mlurl}. +% \begin{macrocode} +\newcommand{\mlurl}{\begingroup\def~{\string~}% + \ef@sanitize@toks\mlurl@} +% \end{macrocode} +% After sanitizing, we save the URL (\texttt{\#2}) an a macro +% \cs{ml@url} using the \cs{urldef} command, defined in the \textsf{url} package. +% \begin{macrocode} +\newcommand{\mlurl@}[2][]{\urldef\ml@url\nolinkurl{#2}% +\def\SOUL@mlhpreamble{%\begingroup + \mlh@preambleCmdInsert\ef@colorthislink}\hyper@chars + \let\ef@thislinkcolor\@urlcolor + \let\CurrentBorderColor\@urlbordercolor +% \end{macrocode} +% Within this group, we direct the \textsf{soul} package to our customized versions of the +% commands. +% \begin{macrocode} + \let\ml@SOUL@doword@SAVE\SOUL@doword + \let\SOUL@doword\ml@SOUL@doword +% \end{macrocode} +% The next several lines are taken from the definition of \cs{mlhypertext}, the basic command +% for construction many of the `\cs{ml}' commands of this package. +% \begin{macrocode} + \global\aeb@arrayIndx=0\relax + \global\advance\aeb@mLinkCnt1\relax + \special{ps: \ps@mark/_objdef {mLink\the\aeb@mLinkCnt}% + /type /array /OBJ pdfmark}% + \def\mlh@preambleCmdInsert{\ml@earlyExecProps{#1}}% + \def\mlh@postambleCmd{\setLinkPbox{\S{S}\W{0}\A{\URI{#2}}% + \presets{\ml@nocolor@defaults} + \QuadPoints{mLink\the\aeb@mLinkCnt}#1}\expandafter +% \end{macrocode} +% The coloring of the hypertext does not work unless we make the definition +% global, so we do so and hope this does not mess other things up. +% \begin{macrocode} + \gdef\expandafter\ef@thislinkcolor + \expandafter{\ef@thislinkcolor}}% +% \end{macrocode} +% Finally, we call \cs{aeb@mlh} which starts \textsf{soul} with \cs{SOUL@}. +% This does this analysis, the custom command build the url in \cs{ml@urlbuild}, which +% we then unbox. +% \begin{macrocode} + \aeb@mlh\ml@url\ef@colorthislink\unhcopy\ml@urlbuild\endgroup +} +% \end{macrocode} +% \end{macro} +% \section{Macros used by the SOUL Interface} +% \begin{macrocode} +\ifHy@colorlinks + \def\ef@colorthislink{\color{\ef@thislinkcolor}} +\else + \let\ef@colorthislink\relax +\fi +% \end{macrocode} +% I've inserted \verb|\let\protect\@empty| to make |mlnameref| and |mlNameref| work. +% \begin{macrocode} +\def\ml@SOUL@stop{\relax} +\def\SOUL@mlhpreamble{\begingroup +% \end{macrocode} +% (2011/12/27) Originally, I had \verb|\let\protect\@empty| here, but removing this +% seems to do no harm, so, we'll go for it. +% \begin{macrocode} +% \mlh@preambleCmdInsert\ef@colorthislink\let\protect\@empty} + \mlh@preambleCmdInsert\ef@colorthislink} +\def\SOUL@mlheverysyllable{% + \mlh@setQuadSyllable{\the\SOUL@syllable}% + \the\SOUL@syllable% + \SOUL@setkern\SOUL@charkern}% +%\def\SOUL@mlheveryspace#1{% +% \mlh@setQuadSyllable{ #1\space\hskip\spaceskip}% +% #1\space\hskip\spaceskip}% +\def\SOUL@mlheveryspace#1{#1\space\hskip\spaceskip}% +\def\SOUL@mlheveryhyphen{% + \discretionary{% + \unkern + \SOUL@setkern\SOUL@hyphkern + \SOUL@sethyphenchar + }{}{}% +} +\def\SOUL@mlheveryexhyphen#1{% + \mlh@setQuadSyllable{\SOUL@setkern\SOUL@hyphkern#1}% + \SOUL@setkern\SOUL@hyphkern#1% + \discretionary{}{}{% + \SOUL@setkern\SOUL@charkern + }% +} +\def\mlh@postambleCmd{\relax} +\def\SOUL@mlhpostamble{\mlh@postambleCmd} +\def\SOUL@mlhsetup{\SOUL@setup + \let\SOUL@preamble\SOUL@mlhpreamble + \let\SOUL@everysyllable\SOUL@mlheverysyllable + \let\SOUL@everyspace\SOUL@mlheveryspace + \let\SOUL@everyhyphen\SOUL@mlheveryhyphen + \let\SOUL@everyexhyphen\SOUL@mlheveryexhyphen + \def\SOUL@postamble{\SOUL@mlhpostamble}% +} +\DeclareRobustCommand*\aeb@mlh{\SOUL@mlhsetup\SOUL@} +% \end{macrocode} +% \begin{macrocode} +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/aeb-mlink/aeb_mlink.ins b/texmf-dist/source/latex/aeb-mlink/aeb_mlink.ins new file mode 100644 index 00000000..db8819d8 --- /dev/null +++ b/texmf-dist/source/latex/aeb-mlink/aeb_mlink.ins @@ -0,0 +1,59 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2006 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2007/05/14} +\def\batchfile{aeb_mlink.ins} +% +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble +\generate +{% + \file{aeb_mlink.sty}{\from{aeb_mlink.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.pdf b/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.pdf Binary files differnew file mode 100644 index 00000000..2d697917 --- /dev/null +++ b/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.pdf diff --git a/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.tex b/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.tex new file mode 100644 index 00000000..4295fd8d --- /dev/null +++ b/texmf-dist/source/latex/aeb-mlink/doc/aebmlink_man.tex @@ -0,0 +1,544 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass{article} +%\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,forcolorpaper, + tight*,latextoc,pro,usetemplates}, + eforms={useui}, + aebxmp +]{aeb_pro} +\usepackage{aeb_mlink} + +%\usepackage{myriadpro} +\usepackage[altbullet]{lucidbry} + +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \textsf{aeb\_mlink} Package\texorpdfstring{\\[1em]}{: }AeB Pro Family}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Wrapping links around to the next line}, + keywords={XMP, E4X, Adobe Acrobat, JavaScript}, + talksite={\url{www.acrotex.net}}, + version={2.0}, + copyrightStatus={True}, + copyrightNotice={Copyright (C) 2006-\the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} +\nocopyright +\DeclareInitView{windowoptions=showtitle} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + + +\def\AcroTeX{Acro\negthinspace\TeX} + +\def\unskipparskip{\vskip-\parskip} +\renewenvironment{sverbatim} +{\parskip0pt\noindent\small\verbatim}{\endverbatim\par\aftergroup\unskipparskip} +\renewenvironment{ssverbatim} +{\parskip0pt\noindent\footnotesize\verbatim}{\endverbatim\par\aftergroup\unskipparskip} + +\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} +\def\meta#1{\textit{\texttt{#1}}} +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\pkg\textsf +\let\env\texttt +\let\opt\texttt +\let\app\textsf + +\let\amtIndent\leftmargini +\def\SUB#1{${}_{\text{#1}}$} + +\newdimen\aebdimen \aebdimen 0pt %\advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} + +\def\cmdtitle#1{\texorpdfstring{\protect\cs{#1}}{\textbackslash{#1}}} + +\renewcommand\hproportionwebauthor{.5} +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-31.25pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\makeatother + +%\parindent0pt\parskip\medskipamount + + +\definePath\bgPath{"C:/Users/Public/Documents/% + ManualBGs/Manual_BG_Print_AeB.pdf"} +\begin{docassembly} +\addWatermarkFromFile({% + bOnTop: false, + cDIPath: \bgPath +}) +\executeSave() +\end{docassembly} + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} + +\tableofcontents + +\selectColors{linkColor=webgreen} + +\section{Introduction} + +This package creates \underbar{m}ulti-line \underbar{link}s, a dream +that I have had for a number of years. The package \pkg{hyperref} +does create links, but generally these links cannot be broken across +lines, unless the application \app{pdflatex} is used to create a +PDF; however, since my workflow is primarily through \app{Acrobat +Distiller}, this does me little good. + +This package uses the \texttt{QuadPoints} entry of the link +annotation dictionary to create a bounding region; consequently, +\textbf{this package requires \app{Acrobat Distiller}} to create a PDF. The +\texttt{QuadPoints} entry in the link annotation is a PDF 1.6 +feature, so these multi-line links will work in Adobe Reader 7.0 or +later. If viewed in a version of Adobe Reader previous to 7.0, the +viewer will use the underlying bounding box, which in the case of +this package, is the entire page. \emph{Because the multi-line links don't +work for versions of Adobe Reader prior to 7.0, this package should +be used only when the reading audience has the required version}. + + +\section{Requirements} + +The following {\LaTeX} packages are the major ones required by \texttt{aeb\_mlink}. +\begin{itemize} + \item \pkg{eforms} provides form and link support, \`a la + {Acro\negthinspace\TeX} (\url{ctan.org/pkg/acrotex}). + \item \pkg{hyperref} provides link support, including the + commands \cs{hyperref}, \cs{hyperlink}, \cs{href}, \cs{nameref}, + \cs{Nameref}, and \cs{href}. + \item \pkg{soul} a very nice package by Melchior FRANZ, used by + \pkg{aeb\_mlink} to hyphenate links (\url{ctan.org/pkg/soul}). +% \nolinkurl{CTAN: tex-archive/macros/latex/contrib/soul/}} + +\end{itemize} + +\section{Package options} + +There are only two package options---the name of the dvi-to-ps converter application to be used---, +these are \opt{dvips} and \opt{dvipsone}.\footnote{\app{dvipsone.exe} is the dvi-to-ps converter +of the Y\&Y {\TeX} System, no longer available, but is used by this author.} The default is \opt{dvips}. + +%\Hy@colorlinksfalse + +\bVerb[\aebdimen=6pt] +\begin{minipage}[t]{.5\linewidth} +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\small] +\documentclass{article} +\usepackage{xcolor} +\usepackage[colorlinks]{hyperref} +\usepackage[!anglemeta(driver)]{aeb_mlink} +\end{Verbatim} +\end{minipage}\quad\begin{minipage}[t]{.4\linewidth} +\begin{Verbatim}[commandchars=!(),fontsize=\small] +\documentclass{article} +\usepackage[designi]{web} +\usepackage[!anglemeta(driver)]{aeb_mlink} +\end{Verbatim} +\end{minipage} +\eVerb Above are two typical preambles for the use of \pkg{aeb\_mlink}: +\begin{itemize} + \item The one on the left inputs \pkg{xcolor} (recommended) and + \pkg{hyperref} explicitly. The \opt{colorlinks} option is + recommended for \pkg{hyperref}. These two are followed by + \pkg{aeb\_mlink}. + \item The preamble representation on the right uses the \pkg{web} + package, which internally inputs both \pkg{xcolor} (if available) and + \pkg{hyperref} (with \opt{colorlinks} option). Again, \pkg{aeb\_mlink} + comes last. +\end{itemize} + +Since \pkg{eforms} is a required package, the \pkg{acrotex} bundle +(\pkg{AeB}) is installed; consequently, if you've set up the \texttt{web.cfg} +configuration file (that accompanies \pkg{AeB}) with either +\cs{ExecuteOptions\darg{dvips}} or \cs{ExecuteOptions\darg{dvipsone}}, the +specification of the \anglemeta{driver} is not normally needed. + +\section{Multi-line link commands} + +We define seven multi-line hypertext link commands: \cs{mlhypertext}, +\cs{mlhyperlink}, \cs{mlhyperref}, \cs{mlnameref}, \cs{mlNameref}, +\cs{href}, and \cs{mlurl}. The first is a basic command that is used in the definitions of +the other six. + +\newtopic\noindent\textbf{Note:} Because of the way the bounding boxes are +constructed, it is best that the bounding rectangle is set on invisible, that +is, the line width of the boundary line is zero. The \opt{colorlinks} option +of \app{hyperref} should be taken. + +\exSrc{mlink_tst}The demo file is \texttt{mlink\_tst.tex}, it illustrates all +the commands -- with the exception of \cs{mlurl} -- of this package. The +demo file for \cs{mlurl} is a separate file and is mentioned in +\hyperref[ss:mlrul]{Section~\ref*{ss:mlrul}}. + +\subsection{\cmdtitle{mlhypertext} (\cmdtitle{mlsetLink})} A general purpose multi-line link command. + +\bVerb[\aebdimen=8pt]\takeMeasure{\string\mlhypertext[\#1]\darg{\#2}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,rulecolor=\color{webblue}] +\mlhypertext[#1]{#2} +\end{Verbatim} +\end{minipage}\quad\takeMeasure{\string\mlsetLink[\#1]\darg{\#2}}% +\begin{minipage}{\bxSize} +\begin{Verbatim}[frame=single,rulecolor=\color{webblue}] +\mlsetLink[#1]{#2} +\end{Verbatim} +\end{minipage} +\endgroup + + +\PD The first parameter is optional, and is used to set the appearance and the actions of the link. +The second parameter is the text around which the link is constructed. + +\CmdDescription The \pkg{eforms} package defines \cs{mlsetLink} to +\cs{mlhypertext} (this is to conform to the naming conventions of +\pkg{eforms}). Either command sets a hypertext link having a default +appearance, and no action. The default appearance is the same as that of +\cs{hyperlink}, the command from \pkg{hyperref}. If \opt{colorlinks} +option was taken in the hyperref package, the text is colored \cs{@linkcolor} +(usually red); otherwise, the text is the default color at the time, and a +boundary rectangle is created by AcroForms with color \cs{@linkbordercolor} +(usually red).\footnote{The \pkg{web} package changes the default coloring of \pkg{hyperref}.} + +\newtopic +For example, the following link is constructed using +\cs{mlhypertext}: \mlhypertext[\A{\JS{app.alert("AcroTeX rocks!")}}]% +{Acrobat Distiller, version~7.0 or greater} was used to +create this PDF document. + +\bVerb\takeMeasure{\string\mlhypertext[\string\A\darg{\string\JS\darg{app.alert("AcroTeX rocks!")}}]\%}% +\begin{dCmd*}{\bxSize} +\mlhypertext[\A{\JS{app.alert("AcroTeX rocks!")}}]% + {Acrobat Distiller, version~7.0 or greater} +\end{dCmd*} +\eVerb In the above example, the link, shown in \textcolor{webgreen}{green} +is broken across lines. Though is is not shown in this example, these links +can break a line at a hyphenation point as well. The optional argument is +used to create an alert box that appears when the link is clicked. + +\subsection{\cmdtitle{mlhyperlink}} A multi-line version of the \cs{hyperlink} command. + +\bVerb\takeMeasure{\string\mlhyperlink[\#1]\darg{\#2}\darg{\#3}}% +\begin{dCmd}{\bxSize} +\mlhyperlink[#1]{#2}{#3} +\end{dCmd} +\endgroup + +\PD The first parameter is optional, and is used to set the appearance, but \textit{not the actions} of the link. +The second parameter is a named destination, perhaps created by the \cs{hypertarget} command of +\pkg{hyperref}. The third parameter is the text around which the link is constructed. + +\CmdDescription This command is the multi-line version of the \pkg{hyperref} command \cs{hyperlink}. +The default appearance is the same as \cs{hyperlink}, as described above in \cs{mlhypertext}. +The action of this link is to jump to a named destination; the action cannot be changed by defining +a different action through the first parameter. + +This link uses the \cs{mlhyperlink} command: +\so{Welcome!} \mlhyperlink{retire}{Welcome, $\dots$ to my humble retirement residence, such as it is!} +\bVerb\takeMeasure{\string\mlhyperlink\darg{retire}\{Welcome, \$\string\dots\$ to my humble}% +\begin{dCmd*}{\bxSize} +\mlhyperlink{retire}{Welcome, $\dots$ to my humble +retirement residence, such as it is!} +\end{dCmd*} +\eVerb In this example, the line is broken at a hyphenation, cool! We jump to +the named destination, \texttt{retire}. On the last page, +the following text appears +\begin{quote} +\verb!My humble retirement \hypertarget{retire}{home}.! +\end{quote} +creating the named destination of \texttt{retire}. + +\subsection{\cmdtitle{mlhyperref}} A multi-line version of the \cs{hyperref} command. + +\bVerb\takeMeasure{\string\mlhyperref[\#1]\darg{\#2}\darg{\#3}}% +\begin{dCmd}{\bxSize} +\mlhyperref[#1]{#2}{#3} +\end{dCmd} +\endgroup +\PD The first parameter is optional, and is used to set the +appearance, but \textit{not the actions} of the link. The second +parameter is a label name created by the \cs{label} command of +\LaTeX. The third parameter is the text around which the link is +constructed. + +\CmdDescription This is the multi-line version of \cs{hyperref}, the command +defined by the \pkg{hyperref} package. The default appearance is the same +as \cs{hyperref}. The action of this link is to jump to a destination created +by the \cs{label} command of the cross-referencing system of \LaTeX; the +action cannot be changed by defining a different action through the first +parameter. + +\newtopic +This link uses the \cs{mlhyperref} command: \mlhyperref[\ui{linktxtcolor=red}]{retirement} +{Welcome! Welcome to my humble retirement residence, such as it is!} + +\bVerb\takeMeasure{\string\mlhyperref[\string\ui\darg{linktxtcolor=red}]\darg{retirement}}% +\begin{dCmd*}{\bxSize} +\mlhyperref[\ui{linktxtcolor=red}]{retirement} +{Welcome! Welcome to my humble retirement +residence, such as it is!} +\end{dCmd*} +\eVerb The user-friendly interface is used to change the appearance of the +color of the link text. The second argument is \texttt{retirement}, which is +the label +affixed to the last section of this document, +\begin{quote} +\verb!\section{My \textbf{Retirement} Home}\label{retirement}! +\end{quote} +See \mlNameref{retirement}. + + +\subsection{\cmdtitle{mlnameref}} A multi-line version of the \cs{nameref} command. + +\bVerb\takeMeasure{\string\mlnameref[\#1]\darg{\#2}}% +\begin{dCmd}{\bxSize} +\mlnameref[#1]{#2} +\end{dCmd} +\endgroup + +\PD The first parameter is optional, and is used to set the appearance, but + \textit{not the actions} of the link. The second parameter is a name of + a {\LaTeX} label. + +\CmdDescription This is the multi-line version of the +\pkg{hyperref} (\pkg{nameref}) command, \cs{nameref}. The default appearance is +the same as \cs{hyperref}. The action of this link is to jump to a +destination created by the \cs{label} command of the +cross-referencing system of \LaTeX; the action cannot be changed by +defining a different action through the first parameter. + +\newtopic +This link uses the \cs{mlnameref} command: Click the link to witness \mlnameref{retirement}. +The code for this link is seen below: +\bVerb\takeMeasure{\string\mlnameref\darg{retirement}}% +\begin{dCmd*}{\bxSize} +\mlnameref{retirement} +\end{dCmd*} +\endgroup + +\subsection{\cmdtitle{mlNameref}} A multi-line version of the +\pkg{hyperref} command, \cs{Nameref}. + +\bVerb\takeMeasure{\string\mlNameref[\#1]\darg{\#2}}% +\begin{dCmd}{\bxSize} +\mlNameref[#1]{#2} +\end{dCmd} +\endgroup +\PD The first parameter is optional, and is used to set the + appearance, but \textit{not the actions} of the link. The second + parameter is a name of a {\LaTeX} label. + +\CmdDescription This is the multi-line version of the \pkg{hyperref} +(\pkg{nameref}) command, \cs{Nameref}. The default appearance is the same as +\cs{hyperref}. The action of this link is to jump to a destination created by +the \cs{label} command of the cross-referencing system of \LaTeX; the action +cannot be changed by defining a different action through the first parameter. + +\newtopic +This link uses the \cs{mlNameref} command: Click the link or go to +the page, \mlNameref{retirement}. The code for the link is seen below: +\bVerb\takeMeasure{\string\mlNameref\darg{retirement}}% +\begin{dCmd*}{\bxSize} +\mlNameref{retirement} +\end{dCmd*} +\endgroup + +\subsection{\cmdtitle{mlhref}} A multi-line version of the +\pkg{hyperref} command, \cs{href}. +\bVerb\takeMeasure{\string\mlhref[\#1]\darg{\#2}\darg{\#3}}% +\begin{dCmd}{\bxSize} +\mlhref[#1]{#2}{#3} +\end{dCmd} +\endgroup + +\PD The first parameter is optional, and is used to set the + appearance, but \textit{not the actions} of the link. The + second parameter is a URL, while the third parameter is the link text. + +\CmdDescription This is the multi-line version of the +\pkg{hyperref} command, \cs{href}. The default appearance is +the same as \cs{hyperref}. There is one of three actions, depending on the +third argument, just as with \cs{href}. The action cannot be changed by +defining a different action through the first parameter. + +%\begingroup +%\makeatletter +%\def\Hy@temp#1{\expandafter\Hy@@temp\csname @#1color\endcsname{#1}} +%\Hy@temp{link}{red} +%\Hy@temp{anchor}{black} +%\Hy@temp{cite}{green} +%\Hy@temp{file}{cyan} +%\Hy@temp{url}{magenta} +%\Hy@temp{menu}{red} +%\makeatother + +\newtopic +The next link uses the \cs{mlhref} command with URL: \mlhref{% +http://www.math.uakron.edu/~dpstory/acrotex.html#educational} +{See the educational offerings of the {Acro\negthinspace{\TeX}} Web +Site at the University of Akron} +\bVerb\takeMeasure{\{See the educational offerings of the \darg{Acro\string\negthinspace\darg{\string\TeX}} Web}% +\begin{dCmd*}{\bxSize} +\mlhref{% +http://www.math.uakron.edu/~dpstory/acrotex.html#educational} +{See the educational offerings of the {Acro\negthinspace{\TeX}} Web +Site at the University of Akron} +\end{dCmd*} +\eVerb +Use the \cs{mlhref} command with mailto URL: My email address at Acro\negthinspace\TeX.Net, +\mlhref{mailto:dpstory@acrotex.net}{dpstory at acrotex dot net}. +\bVerb\takeMeasure{\string\mlhref\darg{mailto:dpstory@acrotex.net}\darg{dpstory at acrotex dot net}}% +\begin{dCmd*}{\bxSize} +\mlhref{mailto:dpstory@acrotex.net}{dpstory at acrotex dot net} +\end{dCmd*} +\eVerb +If the second argument is a PDF file, the PDF viewer will open it from your local file system, +or if you are in a browser, will open it from the web, provided it can find the relative path +\bVerb\takeMeasure{shameless advertisement for Acro\string\negthinspace\string\TeX\}.}% +\begin{dCmd*}{\bxSize} +\mlhref{shameless_ad.pdf}{Here is a +shameless advertisement for Acro\negthinspace\TeX}. +\end{dCmd*} +\eVerb If the key word `\texttt{run:}' is used, the link is set up to launch +an application. The PDF viewer will attempt to open the file with the +application associated with the extension of the file provided. +\bVerb\takeMeasure{\string\mlhref\darg{run:\string\jobname.tex}\darg{This is the source file of this document}.}% +\begin{dCmd*}{\bxSize} +\mlhref{run:\jobname.tex}{This is the source file of this document}. +\end{dCmd*} +\endgroup + +\subsection{\cmdtitle{mlurl}}\label{ss:mlrul} + +A multi-line version of the \cs{url} command of the \pkg{url} package. +The \pkg{hyperref} modifies this command to make it into an unbreakable link (at least for those +using \app{Distiller}). +\bVerb\takeMeasure{\string\mlurl[\#1]\darg{\#2}}% +\begin{dCmd}{\bxSize} +\mlurl[#1]{#2} +\end{dCmd} +\endgroup + +\PD The first parameter is optional, and is used to set the + appearance, but \textit{not the actions} of the link. The + second parameter is a URL, the text of the link is the same as the URL. + +\CmdDescription This is the multi-line version of the +\pkg{url}/\pkg{hyperref} command, \cs{hurl}. The default appearance is +the same as set by \cs{hyperref}. + +\newtopic +The next link is an example of \cs{mlurl}: +\mlurl{http://www.math.uakron.edu/~dpstory/acrotex.html#educational}. The code for this link is found below: +\bVerb\takeMeasure{\string\mlurl\darg{http://www.math.uakron.edu/\string~dpstory/acrotex.html\#educational}}% +\begin{dCmd*}{\bxSize} +\mlurl{http://www.math.uakron.edu/~dpstory/acrotex.html#educational} +\end{dCmd*} +\eVerb The \pkg{url} package typesets the URL in math mode, which makes it +very difficult to wrap it to the next line with a hypertext link around it. +In math mode, spaces are ignored; consequently, if the URL contains spaces, +use \verb!\%20! (with backslash), the URL encoding for the space character. +See the Internet reference +\mlurl{http://www.w3schools.com/tags/ref_urlencode.asp} for a discussion of +the \textbf{\caps{HTML URL Encoding Reference}}. + + +\exSrc{mlink_tst_url}The demo file that illustrate all the commands to +follow is \texttt{mlink\_tst\_url.tex}. Additional details and examples are found in this +example file. + +\section{Setting the appearance and action} + +The appearance and the action (at least for \cs{mlhypertex}) can be set through the first +optional parameter. The optional parameter takes key-value pairs of two types: +\paragraph*{Key-value Pairs.} The optional first parameter of each of the form and link commands take +two styles of key-values: +\begin{enumerate} + \item eForms KVP: This is the key-value system originally developed, where each KVP has the form + \cs{\anglemeta{key}\darg{\anglemeta{val}}}. Through these keys, the appearance + and action of a link---if otherwise not restricted---may be set. + For example, \mlhypertext[\S{U}\W{1}\Color{0 0.6 0} + \linktxtcolor{webgreen} \A{\JS{app.alert("AcroTeX + rocks!")}}]{AcroTeX can be found at + \texttt{www.acrotex.net}, as close as your nearest web + browser.} +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\mlhypertext[\S{U}\W{1}\Color{0 0.6 0}\linktxtcolor{webgreen} +\A{\JS{app.alert("AcroTeX rocks!")}}]{AcroTeX...browser.} +\end{Verbatim} + + The eForms KVP system is explained in the eforms manual, + \textsl{\mlhref{http://www.math.uakron.edu/~dpstory/acrotex/eformman.pdf}{Support for AcroForms and Links, and for Document JavaScript and Open Page Events}},\footnote + {\url{http://www.math.uakron.edu/~dpstory/acrotex/eformman.pdf}} + where a complete listing of all supported KVPs is found in the appendices. + + \item \pkg{xkeyval} KVP: When the \opt{useui} option is taken of the eforms package, key-value pairs are + defined of the form \texttt{\anglemeta{key}[\,=\,\anglemeta{value}]}. The key-value pairs are actually a value of + a special eForms key, \cs{ui}. The value of \cs{ui} consists of a comma-delimited list of + \pkg{xkeyval} key-value pairs. For example, + \mlsetLink[\ui{% + border=visible, + linestyle=underlined, + bordercolor={0 0.6 0}, + linktxtcolor=webgreen, + js={app.alert("AcroTeX rocks!")}}]{AcroTeX + can be found at \texttt{www.acrotex.net}, as + close as your nearest web browser.} +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\mlsetLink[\ui{% + border=visible, + linestyle=underlined, + bordercolor={0 0.6 0}, + linktxtcolor=webgreen, + js={app.alert("AcroTeX rocks!")}}]{AcroTeX...browser.} +\end{Verbatim} + + + \item[] The \pkg{xkeyval} KVP system is described in the document + \textsl{\mlhref{http://www.math.uakron.edu/~dpstory/acrotex/eformman.pdf}{Support for AcroForms and Links, and for Document JavaScript and Open Page Events}}.\footnote + {ibid.} + +\end{enumerate} + +\newpage + +\section{My \textbf{Retirement} Home}\label{retirement} + +My humble retirement \hypertarget{retire}{home}. +\begin{flushleft} +\setLink[\H{N}\A{\Named{GoBack}}]{\includegraphics[scale=.5]{DSC01404}}\quad \raisebox{75pt}{\textbf{Click image to return from jump}} +\end{flushleft} + + +\newtopic\noindent +Now, I simply must get back to my retirement. \dps + + + +\end{document} diff --git a/texmf-dist/source/latex/aeb-pro/aeb.js b/texmf-dist/source/latex/aeb-pro/aeb.js new file mode 100644 index 00000000..09310d2e --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/aeb.js @@ -0,0 +1,24 @@ +/* + AEB Import FDF Methods + + Copyright (C) 2006--2016 AcroTeX.Net + D. P. Story + http://www.acrotex.net + + Version 1.0 +*/ +if ( typeof aebTrustedFunctions == "undefined") { + aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs ) + { + app.beginPriv(); + var retn = oFunction( oArgs, doc ) + app.endPriv(); + return retn; + }); +} +aebImportAnFDF = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + doc.importAnFDF(oArgs); + app.endPriv(); +}); diff --git a/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx b/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx new file mode 100644 index 00000000..3cde5508 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/aeb_pro.dtx @@ -0,0 +1,4903 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aeb_pro.sty package, %% +%% Copyright (C) 2006--2017 D. P. Story %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%<package>\ProvidesPackage{aeb_pro} +%<package> [2017/03/08 v2.8a aeb_pro: A support package (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\pdfstringdefDisableCommands{\let\\\textbackslash} +\def\CMD#1{\textbackslash{#1}}\def\EXCL{!} +\let\opt\texttt \let\app\textsf \let\pkg\textsf \let\env\texttt +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\bgroup\ttfamily +\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup +\let\darg\brpr +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{aeb_pro}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{aeb_pro}{aebdocfmt.def cannot be found}} +\begin{document} + \GetFileInfo{aeb_pro.sty} + \title{aeb\_pro\\as suggested by J\"{u}rgen Gilg} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net}} + \date{processed \today} + \maketitle + \tableofcontents + \DocInput{aeb_pro.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o aeb\_pro.ind aeb\_pro.idx} on the command line and recompile + \texttt{aeb\_pro.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o aeb\_pro.gls aeb\_pro.glo} on the command line and recompile + \texttt{aeb\_pro.dtx}.} +\end{document} +%</driver> +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{aeb_pro}{Inputting aebdonotindex.def}} +% {\PackageInfo{aeb_pro}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +% Begin package segment +%<*package> +% \end{macrocode} +% \changes{v1.9}{2016/03/03}{Allow users of pdftex and xetex to access JavaScript related +% methods provided they use \string\textsf{Acrobat} as their PDF reader.} +% \changes{v2.5}{2016/08/31}{Revised \string\texttt{aeb\_pro.js} to include +% \string\texttt{aebDocSaveAs()}.} +% +% \section{Introduction} +% +% The \pkg{aeb\_pro} package that access the `advanced' features of the PDF +% specification. It uses various combinations of driver-dependent code, +% \textbf{pdfmark} code, and JavaScript methods and techniques that require +% \app{Acrobat~7.0 Professional} for document assembly. The package provides +% the \textbf{AeB Control Central}. Use the \textbf{AeB Control Central} to +% load all your Acro\negthinspace\TeX packages in the correct order. See +% additional remarks in the titled paragraph \textbf{\nameref{para:beast}} +% below. +% +% \section{Declare Options} +% +% We declare some options for this package. +%\changes{v2.2}{2016/07/26}{Removed the generation of \string\texttt{fsprodef.js} from the INS file.} +% \begin{macrocode} +\RequirePackage{ifpdf}[2006/02/20] +\RequirePackage{ifxetex}[2006/08/21] +\RequirePackage{xkeyval} +% \end{macrocode} +% Some standard flags used by this package. +% \begin{macrocode} +\let\aebp@One=1 \let\aebp@Zero=0 +\let\aebp@YES=y \let\aebp@NO=n +% \end{macrocode} +% \subsection{AeB Control Central} +% +% \noindent\IndexOpt{web}^^A +% \IndexOpt{exerquiz}^^A +% \IndexOpt{dljslib}^^A +% \IndexOpt{eforms} +% \IndexOpt{insdljs}^^A +% \IndexOpt{eq2db}\par +% \IndexOpt{aebxmp}^^A +% \IndexOpt{hyperref}^^A +% \IndexOpt{graphicxsp}^^A +% \IndexOpt{rmannot}^^A +% \vskip-\baselineskip\noindent AeB control central +% is simply a set of options for including the +% other members of the AeB family. This assures that the package are +% loaded in the correct order. +% The values of each of these option +% keys are the options of the packages they reference. +% \par\medskip\noindent +% (2016/12/09) Incorporate the version argument into package specification, for example, +%\begin{verbatim} +% \usepackage[web={designi,forpaper,req=2016/11/03}]{aeb_pro} +%\end{verbatim} +% The version takes a key of \texttt{req}, as shown above. +% \changes{v0.8f}{2008/06/15}{Added \textsf{graphicxsp} to the list of support packages} +% \changes{v2.7}{2016/12/10}{Incorporate the version argument into package specification} +% \par\medskip\noindent +% \cs{ap@csarg} is a convenience macro for working with command names. +% \begin{macrocode} +\def\ap@csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% Define an \pkg{xkeyval} family \texttt{aebpreq} with a single key \IndexKey{req}\texttt{req}. Later, we +% use this key to separate package options from the key-value \texttt{req=\ameta{release date}}. +% \begin{macrocode} +\define@key{aebpreq}{req}[]{\def\eq@pkgReq{#1}} +% \end{macrocode} +% A convenience command to save the value of package for later use. +% \begin{macrocode} +\def\aebp@setCCOptions#1#2{%#1=package #2=options + \ap@csarg\edef{aeb@#1@opts}{#2}} +% \end{macrocode} +% We not define options for \pkg{aeb\_pro} of \texttt{web}, \texttt{exerquiz}, \texttt{eforms}, \texttt{insdljs}, +% \texttt{eq2db}, \texttt{aebxmp}, \texttt{hyperref}, \texttt{graphicxsp}, and \texttt{rmannot}. +% \begin{macrocode} +\@tfor\aeb@pcks:={web}{exerquiz}{dljslib}% +{eforms}{insdljs}{eq2db}{aebxmp}{hyperref}{graphicxsp}{rmannot}\do +{% + \ap@csarg\let{aeb@\aeb@pcks @req}\@empty + \ap@csarg\let{aeb@\aeb@pcks @opts}\relax + \edef\aeb@pack@def{\noexpand + \define@key{aeb_pro.sty}{\aeb@pcks}[]{% + \noexpand\aebp@setCCOptions{\aeb@pcks}{##1}}% + }\aeb@pack@def +} +% \end{macrocode} +% We provide a convenient way to pass the \texttt{driver}\IndexOpt{driver} used, \texttt{dvips} or +% \texttt{dvipsone}. If the user chooses the \opt{web} option, then he/she might +% have a \texttt{web.cfg} file, so using this option may not be +% needed, in this case. +% \begin{macrocode} +\let\aebp@passDriver\aebp@YES +\ifpdf\let\aebp@passDriver\aebp@NO\else +\ifxetex\let\aebp@passDriver\aebp@NO\fi\fi +\define@choicekey+{aeb_pro.sty}{driver}% + {dvipsone,dvips,pdftex,dvipdfm,textures,% + dvipdfmx,xetex}{% + \def\aeb@driver{#1}\ifx\aeb@driver\@empty\else + \PassOptionsToPackage{#1}{web} + \PassOptionsToPackage{#1}{exerquiz} +\def\aebp@PassToHYIns{\PassOptionsToPackage{#1}{hyperref} + \PassOptionsToPackage{#1}{insdljs}} +\ifx\aebp@passDriver\aebp@YES + \expandafter\aebp@PassToHYIns\fi + \PassOptionsToPackage{#1}{eforms} + \PassOptionsToPackage{#1}{graphicxsp} + \fi +}{\PackageError{aeb_pro}{Bad choice for the driver, permissible values + \MessageBreak are dvipsone, dvips, pdftex, dvipdfm, + textures,\MessageBreak dvipdfmx, and xetex} + {Try again with a permissible driver name}} +\let\aeb@driver\@empty +% \end{macrocode} +% +% \paragraph*{On the nature of the beast}\label{para:beast} There are three types of commands +% (and environments) in this package: (1) commands that use driver dependent +% code, available to all workflows; (2) commands that depend on the +% \textbf{pdfmark} operator, available only to the \app{dvips/Distiller} +% workflow; and (3) commands that use `post-PDF creation' methods that rely +% on the document author having the full \app{Acrobat} application. +% +% For the workflow \app{dvips/Distiller}, all three code types are +% available; for whose authors that prefer \app{pdflatex/\penalty0 +% lualatex/\penalty0 xelatex}, but \emph{do not have} the full +% \texttt{Acrobat} product, the commands of type~(1) are available through +% the \opt{nopro} option. Finally, for authors that prefer +% \app{pdflatex/\penalty0 lualatex/\penalty0 xelatex} and \emph{do have} +% \app{Acrobat}, the commands of type~(1) and~(3) are available through +% the \opt{useacrobat} option. + +% \subsection{The \texttt{useacrobat} option} +% +% If the document author has \app{Acrobat}, but wants to use +% \app{pdflatex}, \app{xelatex}, etc, we shall let them but under +% restricted conditions using the \opt{useacrobat}\IndexOpt{useacrobat} option. +% Essentially, all of \pkg{aeb\_pro} is available except for any commands that use +% layers; hence, the \opt{uselayers} and \opt{ocganime} options are not supported. +% \begin{macrocode} +\newif\if@useacrobat \@useacrobatfalse +\DeclareOptionX{useacrobat}{\@useacrobattrue} +% \end{macrocode} +% +% \subsection{\texttt{nopro} option} +% +% The normally \pkg{aeb\_pro} will brings in all the +% code that would require the use of the \app{Distiller} and \app{Acrobat Pro}, +% this is the default. The \opt{nopro}\IndexOpt{nopro} option gives +% access, for non-\app{Distiller} workflows, to the \textbf{AeB Control Center} and to all commands that do +% no involve layers or post-PDF creation methods. +% \begin{macrocode} +\newif\if@gopro \@goprotrue +\DeclareOptionX{nopro}{\@useacrobattrue\@goprofalse + \PassOptionsToPackage{nopro}{insdljs}} +% \end{macrocode} +% \paragraph*{Input \texttt{aebpro.def}} We input \texttt{aebpro.def} at the end of the package. +% \begin{macrocode} +\def\aeb@InputAeBPro{\InputIfFileExists{aebpro.def}% + {\PackageInfo{aeb_pro}{Inputting code for the pro option}}% + {\PackageInfo{aeb_pro}{Cannot find aebpro.def. + Reinstall or refresh your file name database, as needed.}}} +\AtEndOfPackage{\aeb@InputAeBPro} +% \end{macrocode} +% +% \subsection{\texttt{uselayers} option} +% The \texttt{uselayers}\IndexOpt{uselayers} option activates the use of +% Optional Content Groups, a.k.a., layers. +% \begin{macrocode} +\let\aebp@uselayers=0 +\DeclareOptionX{uselayers}{% + \ifx\aebp@uselayers0\AtEndOfPackage{\aeb@InputAeBLayers}% + \global\let\aebp@uselayers=1\fi +} +\def\aeb@InputAeBLayers{\InputIfFileExists{aeblayers.def}% + {\PackageInfo{aeb_pro}{Inputting code for uselayers option}}% + {\PackageInfo{aeb_pro}{Cannot find aeblayers.def. + Reinstall or refresh your file name database.}}} +% \end{macrocode} +% +% \subsection{\texttt{gopro} option} +% Some of the components of AeB have the pro option. Use \texttt{gopro}\IndexOpt{gopro} to +% pass the \texttt{pro} option to all components that take it. +% \begin{macrocode} +\DeclareOptionX{gopro}{\PassOptionsToPackage{pro}{web}} +% \end{macrocode} +% \subsection{\texttt{attachsource} option} +% A simple interface, \texttt{attachsource}\IndexOpt{attachsource} to attaching the source file(s) of \cs{jobname}. +% \begin{macrocode} +\DeclareOptionX{attachsource}{\def\aeb@attachsource{#1}} +\let\aeb@attachsource\@empty +% \end{macrocode} +% \subsection{\texttt{attachments} option} +% The \texttt{attachments}\IndexOpt{attachments} option is a general routine +% for attaching files other than the \cs{jobname}. +% \begin{macrocode} +\DeclareOptionX{attachments}{\def\aeb@attachments{#1}} +\let\aeb@attachments\@empty +% \end{macrocode} +% \changes{v1.4}{2013/02/24}{Support for optional attachments} +% The two options, \texttt{optattachments}\IndexOpt{optattachments} and \texttt{!optattachments}\IndexOpt{!optattachments}, +% set the Booleaqn switch \cs{ifoptattachments} to true or false, respectively. +% the default is false. When the command \cs{prjInput} is used, files are input into +% the source file, but also attached to the PDF when \texttt{optattachments} is used, and not +% attached when \texttt{!optattachments} is used. +% \begin{macrocode} +\newif\ifoptattachments\optattachmentsfalse +\newif\ifoptattachmentsTaken\optattachmentsTakenfalse +\DeclareOptionX{optattachments}{% + \optattachmentsTakentrue + \optattachmentstrue} +\DeclareOptionX{!optattachments}{% + \optattachmentsTakentrue + \optattachmentsfalse} +% \end{macrocode} +% \subsection{The \texttt{linktoattachments} option} +% The option \texttt{linktoattachments}\IndexOpt{linktoattachments} is a +% general routine for linking to attached PDF files. +% \begin{macrocode} +\def\@aeb@InputUnicodes{\InputIfFileExists{unicodes.def}% + {\typeout{aeb_pro: Inputting code for the linktoattachments option}}% + {\typeout{aeb_pro: Cannot find unicodes.def. + Reinstall or refresh your file name database, as needed.}}} +\let\aeb@InputUnicodes\@empty +% \end{macrocode} +% \changes{v1.7k}{2015/08/06}{Added code so that the childof is read after linktoattachments} +% (2015/08/06) Added code so that the childof is read after linktoattachments +% \changes{v2.4}{2016/08/03}{Removed the \string\texttt{latin1} option as unworkable across some workflows} +% \begin{macrocode} +\DeclareOptionX{linktoattachments}{% + \let\aeb@InputUnicodes\@aeb@InputUnicodes} +\let\aeb@childofInput\@empty +\let\aeb@childof\@empty +\DeclareOptionX{childof}{\def\aeb@childof{#1}\def\aeb@childofInput{% + \InputIfFileExists{\aeb@childof_xref.cut}{}{}}} +\def\inputAttachmentRelatedFiles{% + \aeb@InputUnicodes + \aeb@childofInput +} +\AtEndOfPackage{\inputAttachmentRelatedFiles} +% \end{macrocode} +% When the \texttt{ocganime}\IndexOpt{ocganime} option is taken, the code for ocg animation is included. +% \begin{macrocode} +\let\inputCommonAnimeCode\relax +\DeclareOptionX{ocganime}{% + \ifx\aebp@uselayers0\ExecuteOptionsX{uselayers} + \global\let\aebp@uselayers=1\fi + \ifx\inputCommonAnimeCode\relax + \let\inputCommonAnimeCode\aebp@inputCommonAnimeCode + \AtEndOfPackage{\inputCommonAnimeCode}\fi + \AtEndOfPackage{\inputOcgAnimeCode} +} +% \end{macrocode} +% When the \texttt{btnanime}\IndexOpt{btnanime} option is taken, the code for button animation is included. +% \begin{macrocode} +\DeclareOptionX{btnanime}{% + \ifx\inputCommonAnimeCode\relax + \let\inputCommonAnimeCode\aebp@inputCommonAnimeCode + \AtEndOfPackage{\inputCommonAnimeCode}\fi + \AtEndOfPackage{\inputBtnAnimeCode} +} +\def\inputBtnAnimeCode{\InputIfFileExists{btnnanime.def} + {\PackageInfo{aeb_pro}{inputting btnnanime.def}} + {\PackageWarning{aeb_pro}{cannot find btnnanime.def}}}% +\def\inputOcgAnimeCode{\InputIfFileExists{ocganime.def} + {\PackageInfo{aeb_pro}{inputting ocganime.def}} + {\PackageWarning{aeb_pro}{cannot find ocganime.def}}}% +\def\aebp@inputCommonAnimeCode{\InputIfFileExists{anime_support.def} + {\PackageInfo{aeb_pro}{inputting anime_support.def}} + {\PackageWarning{aeb_pro}{cannot find anime_support.def}}}% +% \end{macrocode} +% We allow for a configuration file, usually of the form +%\begin{verbatim} +% \ExecuteOptionsX{driver=<driver>} % dvips, dvipsone, pdftex, xetex +%\end{verbatim} +% For the last two, \app{AeB Pro} can only act as a central control of +% the \app{AeB} Family. +% \changes{v1.7}{2015/06/12}{Added a test for \texttt{pdftex} and \texttt{xetex}} +% If the driver being used (automatically detected) is \texttt{pdftex} or \texttt{xetex}, we +% use the \texttt{nopro} option and don't input \texttt{aebpro.cfg}. +% \begin{macrocode} +\let\pathToBtnCtrlIcons\@empty +\let\ExecuteOptionsXSAVE\ExecuteOptionsX +\let\ExecuteOptionsX\@gobble +\InputIfFileExists{aebpro.cfg}{}{} +\let\ExecuteOptionsX\ExecuteOptionsXSAVE +\ifpdf\ExecuteOptionsX{driver=pdftex}\else + \ifxetex\ExecuteOptionsX{driver=xetex}\else + \@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{driver=dvips}} + {\ExecuteOptionsX{driver=dvipsone}}\fi\fi +% \end{macrocode} +% \paragraph*{Process the options} +% \begin{macrocode} +\ProcessOptionsX +\edef\ap@restoreCats{% + \catcode`\noexpand\"=\the\catcode`\"\relax + \catcode`\noexpand\,=\the\catcode`\,\relax + \catcode`\noexpand\(=\the\catcode`\(\relax + \catcode`\noexpand\!=\the\catcode`\!\relax +} +\@makeother\"\@makeother\,\@makeother\(\@makeother\! +% \end{macrocode} +% \paragraph*{Set up variables} +% We set a switch to indicate we are using the \textbf{pdfmark} operator or not. +% Initially we assume so. +% \changes{v1.9}{2016/03/03}{Set up \string\cs{ifpdfmark} switch earlier} +% \begin{macrocode} +\@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{} +\pdfmarkuptrue +% \end{macrocode} +%\changes{v2.2}{2016/07/26}{Added support for luatex .85} +% Added support for luatex .85. Moved this code to \pkg{insdljs} (2016/07/31); \pkg{aeb\_pro} requires +% \pkg{insdljs} so put it there. +%\begin{verbatim} +% \ifpdf\ifx\pdffeedback\@undefined\else +% \def\pdfpageref{\pdffeedback pageref}\fi\fi +%\end{verbatim} +% Set the variables for the case of \opt{dvips} and \opt{dvipsone}. +% \changes{v1.9}{2016/03/03}{Modified driver check, adding \string\cs{@useacrobattrue}} +% \begin{macrocode} +\def\aeb@testdriver{dvips}% +\ifx\aeb@testdriver\aeb@driver + \@useacrobattrue\else +\def\aeb@testdriver{dvipsone}% +\ifx\aeb@testdriver\aeb@driver + \@useacrobattrue\else +% \end{macrocode} +% If not \texttt{dvips} or \texttt{dvipsone}, the user is +% not to use the \textbf{pdfmark} operator. +% \changes{v1.9}{2016/03/03}{Mark as non-pdfmark} +% \begin{macrocode} + \pdfmarkupfalse +\fi\fi +% \end{macrocode} +% \paragraph*{Summary of switch settings} +% \begin{itemize} +% \item \app{Distiller} workflow: \cs{pdfmarkuptrue}, \cs{@useacrobatrue}, \cs{@goprotrue} +% \item non-\app{Distiller}/non-\app{Acrobat} workflow (the \opt{nopro} option): +% \cs{pdfmarkupfalse}, \cs{@useacrobatrue}, \cs{@goprofalse} +% \item non-\app{Distiller}/\app{Acrobat} workflow (the \opt{useacrobat} option): +% \cs{pdfmarkupfalse}, \cs{@useacrobatrue}, \cs{@goprotrue} +% \end{itemize} +% Some options are not valid when using the \opt{nopro}, such as attachments. +% \begin{macrocode} +\if@gopro\else +\let\aebp@isattach\aebp@NO +\ifx\aeb@attachsource\@empty\else\let\aebp@isattach\aebp@YES\fi +\ifx\aeb@attachments\@empty\else\let\aebp@isattach\aebp@YES\fi + \let\aeb@attachsource\@empty + \let\aeb@attachments\@empty + \optattachmentsfalse\optattachmentsTakenfalse + \let\inputAttachmentRelatedFiles\relax +\ifx\aebp@isattach\aebp@YES + \PackageWarningNoLine{aeb_pro}{The various attachment options + are not\MessageBreak supported with the nopro option, + ignoring them}\fi +\fi +% \end{macrocode} +% \paragraph*{Disallow some options that use the \textsf{pdfmark}} +% We do what we say. +% \begin{macrocode} +\ifpdfmarkup\else +\if\aebp@uselayers1 + \def\aeb@InputAeBLayers{\PackageError{aeb_pro} + {The uselayers and ocganime options are not supported,\MessageBreak + with the useacrobat and nopro options,\MessageBreak + ignoring these options}{Remove dependence on layers, + or obtain\MessageBreak the full Acrobat product}} + \let\texHelpIndicator\@gobble + \let\addJStexHelpEnter\@gobble + \let\addJStexHelpExit\@gobble + \let\texHelp\@gobbletwo + \def\xBld#1\eBld{} + \let\defineRC\@gobbletwo + \let\insertRC\@gobble + \let\definePR\@gobbletwo + \let\insertPR\@gobble + \let\proofRollovers\relax + \let\texPHProof\@gobbletwo + \newcommand\animeBld[1][]{} + \def\DeclareAnime#1#2#3{} + \newcommand\backAnimeBtn[3][]{} + \newcommand\clearAnimeBtn[3][]{} + \newcommand\forwardAnimeBtn[3][]{} +\fi\fi +% \end{macrocode} +% +% \section{Package requirements} +% +% AeB builds on the \textsf{web} package to a certain extent, +% hence requires \textsf{insdljs}. +% \begin{macrocode} +\def\aebp@PkgWarningi#1{\ifpdfmarkup\else\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller,\MessageBreak + do not load this package}\fi} +\def\aebp@PkgWarningii#1{\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller,\MessageBreak + ignoring #1\space as an option}} +\def\aebp@PkgWarningiii#1{\PackageWarningNoLine{aeb_pro} + {The #1\space package requires Adobe Distiller or\MessageBreak + the useacrobat option (Acrobat required),\MessageBreak + ignoring #1\space as an option}} +\providecommand\getargsii[2]{\def\aeb@argi{#1}\def\aeb@argii{#2}} +% \end{macrocode} +% \cs{ap@RP} is a command that computes the appropriate +% \cs{PassOptionsToPackage} and \cs{RequiredPackage} commands +%\begin{verbatim} +% #1 aeb_pro required options, #2 = package name +%\end{verbatim} +% \begin{macrocode} +\newcommand\ap@RP[2][]{\def\@rgi{#1}\def\@rgii{#2}% + \ifx\@rgi\@empty\else\edef\@rgi{[\@rgi]}\fi + \@ifnextchar[%] + {\ap@@RP}{\ap@@RP[]}} +% \end{macrocode} +% \cs{ap@@RP} continues \cs{ap@RP} and is the one that formulates +% \cs{PassOptionsToPackage} and \cs{RequiredPackage} commands +%\begin{verbatim} +% #1 = aeb_pro required date +%\end{verbatim} +% \begin{macrocode} +\def\ap@@RP[#1]{\def\@rgiii{#1}% + \let\XKV@rm\@empty\let\eq@pkgReq\@empty + \@ifundefined{aeb@\@rgii @opts} + {\ifx\@rgi\@empty\else + \ap@csarg\edef{aeb@\@rgii @req}{#1}\fi + }{% +% \end{macrocode} +% Calculate \cs{PassOptionsToPackage} and its arguments +% \begin{macrocode} + \edef\x{\noexpand + \setkeys*{aebpreq}{\@nameuse{aeb@\@rgii @opts}}}\x + \edef\eq@theseOpts{\XKV@rm}% + \ap@csarg\edef{aeb@\@rgii @req}{\eq@pkgReq}% + \edef\x{\noexpand + \PassOptionsToPackage{\eq@theseOpts}{\@rgii}}\x + }% +% \end{macrocode} +% Construct \cs{RequirePackage} and its arguments +% \begin{macrocode} + \ifx\@rgiii\@empty + \if!\@nameuse{aeb@\@rgii @req}!\else + \ap@csarg\edef{aeb@\@rgii @req}{[\@nameuse{aeb@\@rgii @req}]}\fi + \else + \@ifl@t@r{#1}{\@nameuse{aeb@\@rgii @req}}% + {\if!\@nameuse{aeb@\@rgii @req}!\else + \ap@csarg\edef{aeb@\@rgii @req}% + {[\@nameuse{aeb@\@rgii @req}]}\fi + }{\ap@csarg\edef{aeb@\@rgii @req}{[#1]}}% + \fi + \edef\x{\noexpand + \RequirePackage{\@rgii}\@nameuse{aeb@\@rgii @req}}\x +} +\@ifpackageloaded{web}{} +{% + \@ifundefined{aeb@web@opts}{}{\ap@RP{web}}% +} +\@ifpackageloaded{exerquiz}{} +{% + \@ifundefined{aeb@exerquiz@opts}{}{\ap@RP{exerquiz}}% +} +\@ifpackageloaded{hyperref}{} +{% + \@ifundefined{aeb@hyperref@opts}{}{\ap@RP{hyperref}}% +} +\@ifpackageloaded{eq2db}{} +{% + \@ifundefined{aeb@eq2db@opts}{}{\ap@RP{eq2db}}% +} +\@ifpackageloaded{dljslib}{} +{% + \@ifundefined{aeb@dljslib@opts}{}{\ap@RP{dljslib}}% +} +\@ifpackageloaded{insdljs}{\let\execjs\aebp@YES} +{% + \ap@RP[execJS]{insdljs}[2016/07/31]% incls conv-xkv +} +\@ifpackageloaded{eforms}{\let\execjs\aebp@YES} +{% + \@ifundefined{aeb@eforms@opts}{} + {\ap@RP[execJS]{eforms}[2017/01/03]}% +} +\@ifpackageloaded{aebxmp}{\aebp@PkgWarningi{aebxmp}} +{% + \@ifundefined{aeb@aebxmp@opts}{} + {\edef\temp@exp{\ifpdfmarkup + \noexpand\ap@RP{aebxmp}\else + \if@useacrobat + \noexpand\ap@RP{aebxmp}[2016/05/12]\else + \noexpand\aebp@PkgWarningiii{aebxmp}\fi\fi}\temp@exp} +} +\@ifpackageloaded{graphicxsp}{\aebp@PkgWarningi{graphicxsp}} +{% + \@ifundefined{aeb@graphicxsp@opts}{} + {\edef\temp@exp{\ifpdfmarkup + \noexpand\ap@RP{graphicxsp}\else + \noexpand\aebp@PkgWarningii{graphicxsp}\fi}\temp@exp} +} +\@ifpackageloaded{rmannot}{\aebp@PkgWarningi{rmannot}} +{% + \@ifundefined{aeb@rmannot@opts}{} + {\edef\temp@exp{\ifpdfmarkup\noexpand\ap@RP{rmannot}\else + \noexpand\aebp@PkgWarningii{rmannot}\fi}\temp@exp} +} +\let\execjs\aebp@YES +\RequirePackage{comment} +\RequirePackage{calc} +\RequirePackage{eso-pic} +\ifpdfmarkup\else\if\aebp@uselayers1 + \excludecomment{printRollover}% + \excludecomment{rollover}% +\fi\fi +% \end{macrocode} +% The following write command is used by both the layers stuff, and the attachments routines. +% \begin{macrocode} +\def\aeb@IWVO{\immediate\write\verbatim@out} +% \end{macrocode} +% \section{Support for PDF help} +% The \DescribeMacro{\pdfHelp}\cs{pdfHelp} macro requires \textsf{eforms}. We define +% the necessary commands for PDF help, as well as some comments needed for \cs{texHelp}, +% which uses layers. +% \changes{v2.1}{2016/05/15}{Moved \string\cs{pdfHelp} from \texttt{aeblayers} to +% \texttt{package} to support non-Distiller workflows.} +% \begin{macrocode} +\newsavebox{\aebsavehelp} +\newcommand{\pdfHelpIndicator}[1]{#1\thinspace${}^{\mbox + {\footnotesize\negthinspace\ding{109}}% + \raisebox{.225ex}{\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} +\def\pdfHelpCnt{0} +\newcommand{\pdfHelp}{\@ifstar{{\count0=\pdfHelpCnt\relax +\advance\count0by1\relax\xdef\pdfHelpCnt{\the\count0 }}% + \pdfHelpi{pdfhelp-\pdfHelpCnt}}{\pdfHelpi}} +\newcommand{\pdfHelpi}[3]{% + \let\rollormargstring\texorpdfstring + \sbox{\aebsavehelp}{\pdfHelpIndicator{#3}}% + \makebox[0pt][l]{\makespecialJS\pushButton[\S{S}\BG{}\BC{}\H{N} + \TU{#2}]{#1}{\wd\aebsavehelp}{11bp}}\usebox{\aebsavehelp}% + \let\rollormargstring\@gobbletwo +} +\newcommand\pdfPHProof[3]{\small\raggedright\texttt{#3}: #2} +\newcommand\pdfPrintHelp{\@ifstar{{\count0=\pdfHelpCnt\relax +\advance\count0by1\relax\xdef\pdfHelpCnt{\the\count0}}% + \pdfPrintHelpi{pdfhelp-\pdfHelpCnt}}{\pdfPrintHelpi}} +\newcommand\pdfPrintHelpi[3]{% + \let\rollormargstring\texorpdfstring + \ifeqforpaper + \ifeq@proofing + \pdfHelp{#1}{#2}{#3}\marginpar{\Hy@pdfstringfalse + \pdfPHProof{#1}{#2}{{\Hy@pdfstringtrue#3}}}\else + \pdfHelpIndicator{#3}\fi + \else + \pdfHelp{#1}{#2}{#3}\ifeq@proofing + \marginpar{\Hy@pdfstringfalse + \pdfPHProof{#1}{#2}{{\Hy@pdfstringtrue#3}}}\fi + \fi + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% \begin{macrocode} +% End of package segment +%</package> +%<*aeblayers> +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% \section{Support for OCG} +% We place PostScript code in the document that supports OCG. +% \subsection{Initialization} +% \begin{macrocode} +\newif\ifaeb@ocOn \aeb@ocOntrue +\ifaeb@ocOn +\AtBeginDocument{% +\headerps@out{% +{/OCProcSet /ProcSet findresource} stopped not +{/initialize get exec} +{ +/BeginOC /pop load def +/EndOC {} def +/SimpleOC /pop load def +/SetOCGInitState {pop pop} bind def +/OCEndPage {} def +/SetOCGIntent {pop pop} bind def +/SetOCGUsage {pop pop} bind def +/AddASEvent {pop pop pop} bind def +} +ifelse +} +}\fi +\ifaeb@ocOn + \AtEndDocument{\literalps@out{{/OCProcSet /ProcSet findresource + /terminate get exec} stopped pop}} +\fi +% \end{macrocode} +% \subsection{Supporting commands for OCG} +% In this section we install the necessary code creating and +% navigating through PDF layers. +% \subsubsection{Document JavaScript in support of OCG} +% \begin{macrocode} +\begin{insDLJS}[getxBld]{aebocg}{AeB Pro: OCG Support} +var ocgs = this.getOCGs(); +var xBlds = new Array(); +%console.println("Reindexing ocgs and creating xBlds"); +if ( ocgs != null ) { + var l = ocgs.length; + for ( i=0; i<l; i++ ) { + if (ocgs[0].name.substring(0,3) == "xb." ) + xBlds.push(ocgs.shift()); + else ocgs.push(ocgs.shift()); + } +} +var assocxLayers = new Array(); +if ( xBlds != null ) { + for ( var i=0; i<xBlds.length; i++) + assocxLayers[xBlds[i].name]=i; +} +function getxBld (name) { + var i = assocxLayers["xb."+name]; + return ( i == undefined ) ? null : xBlds[i]; +} +function toggleHelp (name) +{ + var o = getxBld(name); + if ( o != null ) o.state = (event.name.indexOf("Enter") != -1); +} +function toggleSetThisLayer(name, bState) { + var oLayer = getxBld(name); + if ( oLayer != null ) + oLayer.state = (arguments.length > 1) ? bState : !oLayer.state; +} +function getLayerState(name) { + var oLayer = getxBld(name); + return ( oLayer != null ) ? oLayer.state : null; +} +\end{insDLJS} +% \end{macrocode} +% \subsubsection{Macros for creating rollovers} +% The following commands were taken from the \textsf{APB} +% package, and slightly modified. +% \changes{v1.3f}{2012/06/01}{Added controls for adding JS code to a +% rollover; used for starting and stopping an anime.} +% \begin{macrocode} +\newcommand{\texHelpIndicator}[1]{#1\thinspace${}^{\mbox + {\footnotesize\negthinspace\ding{109}}\raisebox{.225ex} + {\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$} +\newcommand{\addJStexHelpEnter}[1]{\def\aebp@addJStexHelpEnter{\r#1}} +\newcommand{\addJStexHelpExit}[1]{\def\aebp@addJStexHelpExit{\r#1}} +\newcommand{\resetaddJStexHelp}{% + \let\aebp@addJStexHelpEnter\@empty + \let\aebp@addJStexHelpExit\@empty +} +\resetaddJStexHelp +\newcommand{\texHelp}[2]{% + \let\rollormargstring\texorpdfstring + \sbox{\aebsavehelp}{\texHelpIndicator{#2}}% + \makebox[0pt][l]{\pushButton[\S{S}\BG{}\BC{}\H{N} + \AA{\AAMouseEnter{\JS{toggleHelp("#1");\aebp@addJStexHelpEnter}}% + \AAMouseExit{\JS{toggleHelp("#1");\aebp@addJStexHelpExit}}}]{#1}% +% \end{macrocode} +%\changes{v1.3h}{2012/11/25}{Changed height calculation in \cs{texHelp}} +% Changed height calculation in \cs{texHelp} to allow a rollover of more +% than text. +% \begin{macrocode} + {\wd\aebsavehelp}{\ht\aebsavehelp+\dp\aebsavehelp}}% + \usebox{\aebsavehelp}\resetaddJStexHelp + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% +% \subsubsection{Macros for layers} +% We have some basic commands for creating layers in AeB Pro. +% \begin{macrocode} +\newif\ifaeb@SimpleOCOn \aeb@SimpleOCOnfalse +\newcommand{\@SOC}[2][false]{\global\aeb@SimpleOCOntrue% + \ifaeb@ocOn\literalps@out{(#2) SimpleOC (#2) #1 SetOCGInitState}\fi} +\newcommand{\b@OC}[2][false]{\ifaeb@SimpleOCOn\@aebSimpleNesterror\fi + \ifaeb@ocOn\literalps@out{(#2) BeginOC (#2) #1 SetOCGInitState}\fi} +\newcommand{\e@OC}{\ifaeb@ocOn\literalps@out{EndOC}\fi} +% \end{macrocode} +% \begin{macro}{\xBld} +% We have some basic commands for creating layers in AeB Pro. +% The syntax for \cs{xBld} is as follows: +%\begin{verbatim} +% \xBld[true|false|print=(true|false)] +% {<layer_name>}<content in layer>\eBld +%\end{verbatim} +%The description of the optional parameters follows: +%\begin{itemize} +% \item \texttt{true}\IndexKey{true}: Inserting \texttt{true} as an optional argument causes the layer to be initially visible. +% \item \texttt{false}\IndexKey{false}: Inserting \texttt{false} as an optional argument causes the layer to be initially hidden. +% The default is \texttt{false}, so if no \texttt{true} or \texttt{false} argument is passed as an optional argument, +% the layer will be initially hidden. +% \item \texttt{print}\IndexKey{print}: This key allows you to set the printability of the layer: If \texttt{print=true}, +% the layer \emph{always prints}, no matter if it is visible or not. If \texttt{print=false}, +% the layer \emph{never prints}, no matter if it is visible or not. If the print key is not specified, +% then the layer will print if visible, otherwise, it does not print. Normally, the \texttt{print} +% key is not specified, and the layer is printed if visible. +%\end{itemize} +% \begin{macrocode} +\newcommand{\xBld}[2][]{% + \setkeys{aebpxBld}{false,#1}\b@OC[\aebpxBld@visible]{xb.#2}% + \ifx\aebpxBld@print\@empty\else + \literalps@out{/Print [/Print] [(xb.#2)] AddASEvent}% + \ifAEBP@aebpxBld@print + \literalps@out{(xb.#2) << /Print<< + /PrintState/ON >> >> SetOCGUsage}% + \else + \literalps@out{(xb.#2) << /Print<< + /PrintState/OFF >> >> SetOCGUsage}% + \fi + \global\let\aebpxBld@print\@empty + \fi +} +\let\eBld\e@OC +\def\@aebSimpleNesterror{\PackageWarning{aeb} +{The scope of the last \string\Bld\space command +\MessageBreak includes the scope of the nested Bld. +\MessageBreak Executing \protect\ocOff\space to correct this. +\MessageBreak The problem occurs}\ocOff} +% \end{macrocode} +% \end{macro} +% The \textsf{keyval} definitions of the optional parameters for \cs{xBld}. +%\changes{v1.7m}{2015/08/08}{Made \texttt{print} key into a choice field} +%(2015/08/08) Made \texttt{print} key into a choice field. +% \begin{macrocode} +\newif\ifAEBP@aebpxBld@print \AEBP@aebpxBld@printfalse +\define@choicekey+{aebpxBld}{print}[\val\nr]{true,false,% + visible,always,never}[visible]{% + \ifcase\nr\relax + \def\aebpxBld@print{true}\AEBP@aebpxBld@printtrue\or + \def\aebpxBld@print{false}\AEBP@aebpxBld@printfalse\or + \let\aebpxBld@print\@empty\or + \def\aebpxBld@print{true}\AEBP@aebpxBld@printtrue\or + \def\aebpxBld@print{false}\AEBP@aebpxBld@printfalse\fi +}{\PackageWarning{aeb_pro}{Bad choice for initState, permissible values + are true, false, visible, always, and never. Try again}} +\let\aebpxBld@print\@empty +\define@key{aebpxBld}{true}[true]{\def\aebpxBld@visible{#1}} +\define@key{aebpxBld}{false}[false]{\def\aebpxBld@visible{#1}} +% \end{macrocode} +% The \texttt{initState}\IndexKey{initState} sets the initial state of the OCG, the +% default is \texttt{false}, meaning the layer is initially not shown. +% \begin{macrocode} +\define@choicekey+{aebpxBld}{initState}[\val\nr]{on,off,% + true,false}[false]{% + \ifcase\nr\relax + \def\aebpxBld@visible{true}\or + \def\aebpxBld@visible{false}\or + \def\aebpxBld@visible{true}\or + \def\aebpxBld@visible{false}\fi +}{\PackageWarning{aeb_pro}{Bad choice for initState, permissible values + are on, off, true and false. Try again}} +% \end{macrocode} +% \subsubsection{The behavior of the rollovers} +% \begin{macro}{\defineRC} +% \begin{macro}{\insertRC} +% RC stands for rollover content. \cs{defineRC} is used to define the content of the rollover +% so the content can be used for the \texttt{rollover} and the \texttt{printRollover} environments. +% These two environments are comment environments that are included or excluded depending on various +% conditions. +% +% The command \cs{csarg} is a convenience command defined in the \texttt{comment} package. +% The \texttt{comment} package is required so this command is available. +% \begin{macrocode} +\long\def\defineRC#1#2{\csarg\def{RC#1}{#2}} +\def\insertRC#1{\@nameuse{RC#1}} +\long\def\definePR#1#2{% + \ifeqforpaper\csarg\def{PR#1}{#2}\else + \ifeq@proofing\csarg\def{PR#1}{#2}\else + \csarg\let{PR#1}\relax\fi\fi +} +\def\insertPR#1{% + \ifeq@proofing\@nameuse{PR#1}\else + \csarg\let{insertPR}\@gobble\fi + \csarg\let{PR#1}\relax +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{environment}{rollover} +% \begin{environment}{printRollover} +% \begin{macro}{\definePR} +% \begin{macro}{\insertPR} +% Depending on the switches \cs{ifeqforpaper} and \cs{ifeq@proofing}, the comment environments +% \texttt{rollover} and \texttt{printRollover} are included or excluded. Also defined here are the +% two commands \cs{definePR} and \cs{insertPR} (PR stands for print rollover). These two commands +% are set equal to either \cs{defineRC} and \cs{insertRC}, or \cs{relax}, depending on the switches. +% +% If \textsf{exerquiz} is not loaded, then the switch \cs{ifeq@proofing} is undefined. We must +% define this switch in this case, and set it to \texttt{false}. +% \begin{macrocode} +\@ifundefined{ifeqforpaper}{\newif\ifeqforpaper \eqforpaperfalse}{} +\@ifundefined{ifeq@proofing}{\newif\ifeq@proofing \eq@proofingfalse}{} +\providecommand\turnProofingOn{\eq@proofingtrue} +\providecommand\turnProofingOff{\eq@proofingfalse} +% \end{macrocode} +% \DescribeMacro\proofRollovers turns on the \texttt{printRollover} environment, if there +% any defined in the document. +% \changes{v1.7}{2015/07/21}{Modified \cs{proofRollovers} command and added +% a number of other related commands.} +% \begin{macrocode} +\def\proofRollovers{% + \ifeqforpaper + \ifeq@proofing + \includecomment{rollover}% + \includecomment{printRollover}% + \else + \excludecomment{printRollover}% + \includecomment{rollover}% + \fi + \else + \ifeq@proofing + \includecomment{rollover}% + \includecomment{printRollover}% + \else + \excludecomment{printRollover}% + \includecomment{rollover}% + \fi + \fi +} +% \end{macrocode} +% We expand \cs{proofRollovers} immediately, but may be expanded in preamble with \cs{turnProofingOn}. +% \begin{macrocode} +\proofRollovers +\@onlypreamble\proofRollovers +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{environment} +% \end{environment} +% \begin{macro}{\texPrintHelp} +% The \cs{texPrintHelp} command reduces to \cs{texHelp} or typesets its second argument. +% \begin{macrocode} +\newcommand\texPHProof[2]{\small\raggedright\texttt{#1}: #2} +\let\rollormargstring\@gobbletwo +\def\texPrintHelp#1#2{% + \let\rollormargstring\texorpdfstring + \ifeqforpaper + \ifeq@proofing + \texHelp{#1}{#2}\marginpar{\Hy@pdfstringfalse + \texPHProof{#1}{#2}}\else + \texHelpIndicator{#2}\fi + \else + \texHelp{#1}{#2}\ifeq@proofing\marginpar{\Hy@pdfstringfalse + \texPHProof{#1}{#2}}\fi + \fi + \let\rollormargstring\@gobbletwo +} +% \end{macrocode} +% \end{macro} +% \subsection{In Support of Anime using Layers} +% Using layers, it is possible to create a sort of animation (anime). The following +% are some rudimentary methods for creating anime. An example can be found below, +% as well as in \texttt{aebpro\_ex4.tex}. +% +% \subsubsection{\protect\LaTeX{} Support} +% \begin{macro}{\animeBld} +% \begin{macro}{\DeclareAnime} +% The command \cs{animeBld} increments \texttt{ocSeq}, and names +% the layer so that the JS can run through the layers in an orderly way. +% +% \cs{DeclareAnime} takes three arguments, the anime base name, the speed at which +% you wish the anime to be played, and the number of frames of this animation. It +% saves these three parameters in macros, and creates \cs{animBldName}, which is used +% in the creation of the anime. See example file \texttt{aebpro\_ex4.tex}. +% \begin{macrocode} +\newcommand{\animeBld}[1][]{\stepcounter{ocSeq}% + \xBld[#1]{\animBldName}} +\newcounter{ocSeq} +% \end{macrocode} +% (10/01/01) We give an animation the special `\texttt{anime!!}' prefix, so JavaScript can identify +% animation layers. +% \begin{macrocode} +\newcommand{\animeName}[1]{anime!!#1}%01/01/2010 +\newcommand{\DeclareAnime}[3] +{% + \setcounter{ocSeq}{0}% + \xdef\animBaseName{anime!!#1}%01/01/2010 + \xdef\animSpeed{#2}\xdef\nFrames{#3}% + \gdef\animBldName{\animBaseName\#\theocSeq}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\backAnimeBtn} +% \begin{macro}{\clearAnimeBtn} +% \begin{macro}{\forwardAnimeBtn} +% The command \cs{animeBld} increments \texttt{ocSeq}, and names +% the layer so that the JS can run through the layers in an orderly way. +% +% \cs{DeclareAnime} takes three arguments, the anime base name, the speed at which +% you wish the anime to be played, and the number of frames of this animation. It +% saves these three parameters in macros, and creates \cs{animBldName}, which is used +% in the creation of the anime. See example file \texttt{aebpro\_ex4.tex}. +% \begin{itemize} +% \item \texttt{\#1}: This is an optional parameter for changing the appearance +% of the button, See the \textsf{eforms} package documentation. +% \item \texttt{\#2}: width of the button +% \item \texttt{\#3}: height of the button +% \end{itemize} +% \begin{macrocode} +\newcommand{\backAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings3}\uCA{FEFF00C5}\TU{Reverse}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersBackward(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnBack}{#2}{#3}% +} +\newcommand{\clearAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings}\CA{n}\TU{Clear}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersClear(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnClear}{#2}{#3}% +} +\newcommand{\forwardAnimeBtn}[3][] +{% + \pushButton[\textFont{Wingdings3}\uCA{FEFF00C6}\TU{Graph It!}#1 + \A{\JS{% + try { aebAnimeTimeOutF.running=false; } catch(e) {}\r + try { aebAnimeTimeOutB.running=false; } catch(e) {}\r + aebAnimeLayersForward(\animSpeed,\nFrames,"\animBaseName"); + }}]{\animBaseName BtnForward}{#2}{#3}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% Here is a simple example if anime, using the above commands. The code +% below uses the \textsf{pstricks-add} and \textsf{fp} packages. +%\begin{verbatim} +%\begin{center} +%\DeclareAnime{sinegraph}{10}{40} +%\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld} +%\psset{llx=-12pt,lly=-12pt,urx=12pt,ury=12pt} +%\begin{psgraph*}[arrows=->](0,0)(-.5,-1.5)(6.5,1.5){164pt}{70pt} +% \psset{algebraic=true}% +% \rput(4,1){$y=\sin(x)$} +% \FPdiv{\myDelta}{\psPiTwo}{\nFrames}% +% \def\xi{0}% +% \multido{\i=1+1}{\nFrames}{\FPadd{\xi}{\xi}{\myDelta}\thisframe} +%\end{psgraph*} +% +%\backAnimeBtn{24bp}{12bp}\kern1bp\clearAnimeBtn{24bp}{12bp}\kern1bp +%\forwardAnimeBtn{24bp}{12bp} +%\end{center} +%\end{verbatim} +% \subsubsection{JavaScript Support} +% \begin{macrocode} +\begin{insDLJS}[_animeLayers]{animelayers} + {AeB Pro: JS in Support of Anime} +var _animeLayers = true; +var aebAnimeTimeOutF = new Object(); +aebAnimeTimeOutF.running=false; +var aebAnimeTimeOutB = new Object(); +aebAnimeTimeOutB.running=false; +var aebAnimeTimeOutC = new Object(); +function aebAnimeLayersForward(animSpeed,nFrames,baseName) +{ + var timeinterval = animSpeed; + aebAnimeTimeOutF = app.setInterval("aebAnimeTimeOutF.count++;" + + "if (aebAnimeTimeOutF.count > " + + nFrames + " || !aebAnimeTimeOutF.running )" + +" app.clearInterval(aebAnimeTimeOutF);\r" + + "else { if (aebAnimeTimeOutF.count == 1 )" + +" getxBld('"+baseName+"\#1').state=true;\t" + + "else { getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutF.count-1)).state=false;\t" + + "getxBld('"+baseName+"\#'" + + "+aebAnimeTimeOutF.count).state=true;}}", timeinterval); + aebAnimeTimeOutF.running = true; + aebAnimeTimeOutF.start = 1; + aebAnimeTimeOutF.count=0; +} +function aebAnimeLayersBackward(animSpeed,nFrames,baseName) +{ + var timeinterval = animSpeed; + aebAnimeTimeOutB = app.setInterval("aebAnimeTimeOutB.count++;\r" + + "if (aebAnimeTimeOutB.count > "+nFrames + +"|| !aebAnimeTimeOutB.running )" + +" app.clearInterval(aebAnimeTimeOutB);\r" + + "else { if (aebAnimeTimeOutB.count == " + +nFrames+") getxBld('"+baseName+"\#1').state=false;\r" + + "else { getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutB.start-% +aebAnimeTimeOutB.count+1)).state=false;\r" + + "getxBld('"+baseName+"\#'" + + "+(aebAnimeTimeOutB.start-% +aebAnimeTimeOutB.count)).state=true;}}", + timeinterval); + aebAnimeTimeOutB.running = true; + aebAnimeTimeOutB.start = nFrames; + aebAnimeTimeOutB.count=0; +} +function aebAnimeLayersClear(animSpeed,nFrames,baseName) +{ + aebAnimeTimeOutF.running = false; + aebAnimeTimeOutB.running = false; + clearFrames = app.setTimeOut( + "hideAllFrames("+nFrames+",\""+baseName+"\")",animSpeed); + var timeinterval = animSpeed; + aebAnimeTimeOutC = app.setInterval("aebAnimeTimeOutC.count++;\r" + + "if (aebAnimeTimeOutC.count >= "+nFrames + +") app.clearInterval(aebAnimeTimeOutC);\r" + + "else { getxBld('"+baseName+"\#'" + +"+(aebAnimeTimeOutC.start-aebAnimeTimeOutC.count)).state=false;}", + timeinterval); + aebAnimeTimeOutC.start = nFrames; + aebAnimeTimeOutC.count=0; +} +function hideAllFrames(n, baseName) +{ + for ( var i=1; i <= n ; i++ ) + getxBld(baseName+"\#"+i).state=false; +} +\end{insDLJS} +% \end{macrocode} +% \begin{macrocode} +% End of the layers segment +%</aeblayers> +%<*aebpro> +% \end{macrocode} +% +% \section{Initial View} +% Supported preferences include \texttt{HideToolbar}, \texttt{HideMenubar}, \texttt{FitWindow}, +% \texttt{Center\-Window}, \texttt{DisplayDocTitle}, +% \texttt{NonFullScreenPageMode} (\texttt{UseNone}, \texttt{UseOutlines}, \texttt{UseThumbs}, +% \texttt{UseOC}, \texttt{UseAttachments}) +% +% \subsection{Window Options} +% +% The keys recognized for the windows options are \texttt{fit}\IndexKey{fit}, +% \texttt{center}\IndexKey{center}, \texttt{fullscreen}\IndexKey{fullscreen}, +% and \texttt{showtitle}\IndexKey{showtitle}. +% \begin{macrocode} +\@tfor\aeb@windowopts:={{fit}{FitWindow}}{{center}{CenterWindow}}% + {{fullscreen}{FullScreen}}{{showtitle}{DisplayDocTitle}}\do +{% + \expandafter\getargsii\aeb@windowopts + \edef\temp@expand@def{% + \noexpand\define@key{aebWindowOpts}{\aeb@argi}[true]{% + \noexpand\def\csname aeb@windowopts\aeb@argii\endcsname{% + /\aeb@argii\space##1}% + }% + }\temp@expand@def + \csarg\let{aeb@windowopts\aeb@argii}\@empty +} +% \end{macrocode} +% \begin{macro}{\setWindowOptions} +% Set the User Window options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setWindowOptions}[1]{\cxkvsetkeys{aebWindowOpts}{#1}} +% \end{macrocode} +% \end{macro} +% \subsection{User Interface Options} +% Key recognized for the use interface options are \texttt{hidetoolbar}\IndexKey{hidetoolbar}, +% \texttt{hidemenubar}\IndexKey{hidemenubar}, and \texttt{hidewindowui}\IndexKey{hidewindowui}. +% \begin{macrocode} +\@tfor\aeb@uiopts:={{hidetoolbar}{HideToolbar}} + {{hidemenubar}{HideMenubar}}{{hidewindowui}{HideWindowUI}}\do{% + \expandafter\getargsii\aeb@uiopts + \edef\temp@expand@def{% + \noexpand\define@key{aebUIOpts}{\aeb@argi}[true]% + {% + \noexpand\edef\csname aeb@uiopts\aeb@argii\endcsname{% + /\aeb@argii\space##1}% + }% + }\temp@expand@def + \csarg\let{aeb@uiopts\aeb@argii}\@empty +} +% \end{macrocode} +% \begin{macro}{\setUIOptions} +% Set the User Interface options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setUIOptions}[1]{\cxkvsetkeys{aebUIOpts}{#1}} +% \end{macrocode} +% \end{macro} +% +% \subsection{Layout and Magnification} +% +% \subsubsection{Navigation Tab (Page Mode)} +% Supported values for the \texttt{navitab}\IndexKey{navitab} key are: +%\begin{itemize} +% \item \texttt{UseNone}: Page Only +% \item \texttt{UseOutlines}: Bookmarks Panel and Page +% \item \texttt{UseThumbs}: Pages Panel and Page +% \item \texttt{FullScreen}: Fullscreen mode +% \item \texttt{UseOC}: Layers Panel and Page +% \item \texttt{UseAttachments}: Attachments Panel and Page +%\end{itemize} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{navitab}{UseNone,UseOutlines,% + UseThumbs,FullScreen,UseOC,UseAttachments}[UseNone]{% + \def\aeb@layoutMagNaviTab{#1}% +}{\PackageWarning{aeb}{Bad choice for PageLayout, permissible values + are UseNone, UseOutlines, UseThumbs, FullScreen,% + UseOC, UseAttachments. Try again}} +\let\aeb@layoutMagNaviTab\@empty +% \end{macrocode} +% \subsubsection{Page Layout} +% Supported value for the \texttt{pagelayout}\IndexKey{pagelayout} key are: +%\begin{itemize} +% \item \texttt{SinglePage}: Single page +% \item \texttt{OneColumn}: Single page continuous +% \item \texttt{TwoPageLeft}: Two-Up (Facing) +% \item \texttt{TwoColumnLeft}: Two-Up Continuous (Facing) +% \item \texttt{TwoPageRight}: Two-Up (Cover Page) +% \item \texttt{TwoColumnRight}: Two-Up Continuous (Cover Page) +%\end{itemize} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{pagelayout}{SinglePage,OneColumn,% + TwoColumnLeft,TwoColumnRight,TwoPageLeft,TwoPageRight}[SinglePage]{% + \def\aeb@layoutMagPageLayout{#1}% +}{\PackageWarning{aeb}{Bad choice for PageLayout, permissible values + are SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, + TwoPageLeft,TwoPageRight. Try again}} +\let\aeb@layoutMagPageLayout\@empty +% \end{macrocode} +% \subsubsection{Magnification} +% Supported values for the \texttt{mag}\IndexKey{mag} key are: +%\begin{verbatim} +% Actual Size <</D[1 0 R/XYZ -32768 -32768 1.0]/S/GoTo>> +% Fit Page <</D[1 0 R/Fit]/S/GoTo>> +% Fit Width <</D[21 0 R/FitH -32768]/S/GoTo>> +% Fit Height <</D[1 0 R/FitV -32768]/S/GoTo>> +% Fit Visible <</D[21 0 R/FitBH -32768]/S/GoTo>> +%\end{verbatim} +% \begin{macrocode} +\define@choicekey+{aebLayoutMag}{mag}[\val\nr]% + {ActualSize,FitPage,FitWidth,FitHeight,FitVisible}[FitPage]% +{% + \ifcase\nr\relax + \edef\aeb@layoutMagMag{\dl@actualsize}\or + \def\aeb@layoutMagMag{\dl@fitpage}\or + \def\aeb@layoutMagMag{\dl@fitwidth}\or + \def\aeb@layoutMagMag{\dl@fitheight}\or + \def\aeb@layoutMagMag{\dl@fitvisible}\fi +% \end{macrocode} +%\changes{v2.2}{2016/07/26}{Change division from postscript operation to a tex calculation} +% Change division from postscript operation to a tex calculation to support the \texttt{useacrobat} option. +% \begin{macrocode} +}{\setlength\@tempdima{1pt*\ratio{\val pt}{100pt}}% + \edef\aeb@layoutMagMag{\dl@mag{\strip@pt\@tempdima}}} +\let\aeb@layoutMagMag\@empty +% \end{macrocode} +% \subsubsection{Open to page} +% The \texttt{openatpage}\IndexKey{openatpage} key takes a page number as its value. +% \begin{macrocode} +\define@key{aebLayoutMag}{openatpage}[1]{\def\aeb@openatpageChoice{#1}% + \ifpdfmarkup\def\aeb@layoutMagPage{Page#1}\else + \def\aeb@layoutMagPage{#1}\fi} +\let\aeb@openatpageChoice\@empty +\let\aeb@layoutMagPage\@empty +% \end{macrocode} +% \begin{macro}{\setLayoutMag} +% Set the Layout and Magnifications options on the Initial View tab of the Document Properties dialog box. +% \begin{macrocode} +\newcommand{\setLayoutMag}[1]{\setkeys{aebLayoutMag}{openatpage=1}% + \cxkvsetkeys{aebLayoutMag}{#1}} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\DeclareInitView} +% This command is the ultimate holder of the Initial View data. It has three keys +% \texttt{layoutmag}\IndexKey{layoutmag}, +% \texttt{windowoptions}\IndexKey{windowoptions} and \texttt{uioptions}\IndexKey{uioptions}. The +% values for each of these three are key values for the commands defined above: +% \cs{setLayoutMag}, \cs{setWindowOptions} and \cs{setUIOptions}. +% \begin{macrocode} +\define@key{aebDeclareInitView}{layoutmag} + {\def\aebDeclareInitView@layoutmag{#1}} +\let\aebDeclareInitView@layoutmag\@empty +\define@key{aebDeclareInitView}{windowoptions} + {\def\aebDeclareInitView@windowoptions{#1}} +\let\aebDeclareInitView@windowoptions\@empty +\define@key{aebDeclareInitView}{uioptions} + {\def\aebDeclareInitView@uioptions{#1}} +\let\aebDeclareInitView@uioptions\@empty +\newcommand{\DeclareInitView}[1]{% + \setkeys{aebDeclareInitView}{#1}% + \edef\temp@expand@sets{% + \noexpand\setLayoutMag{\aebDeclareInitView@layoutmag}% + \noexpand\setWindowOptions{\aebDeclareInitView@windowoptions}% + \noexpand\setUIOptions{\aebDeclareInitView@uioptions}% + }\temp@expand@sets +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\taggedPDF} +% Added 07/08/09 to support tagged pdf, principally tabbing using structure. Strictly +% speaking, the document need not be marked as tagged. +% \begin{macrocode} +\providecommand{\taggedPDF}{\def\aeb@TaggedPDF{true}} +\let\aeb@TaggedPDF\@empty +\@onlypreamble\taggedPDF +% \end{macrocode} +% \end{macro} +% Additional Open action +% \begin{macro}{\additionalOpenAction} +% Document open action, this command is renamed to \cmd{\addToDocOpen} and enhanced. +% \begin{macro}{\addToDocOpen} +% \changes{v1.7}{2015/06/11}{Renamed \cmd{\additionalOpenAction} to +% \cmd{\addToDocOpen}, this version is additive.} +% This command enhances \cmd{\additionalOpenAction}. This version can be used +% several times in the preamble with possibly different action types. +% Use the command \cmd{\addToDocOpen} to include additional action to be performed when the +% document opens. This is different from the actions that may be performed when the first page +% is opened. In fact, \emph{this action is independent of what what page is initially opened}. +% \begin{macro}{\requiresVersion} +%\changes{v0.8h}{2008/07/19} +%{ +% Added an optional argument to \cs{requiresVersion}, to give the option +% of only warning the user that a certain version is required; no exiting +% of the document is forced on the user. +%} +% \cmd{\requiresVersion} can be used to put a version condition on viewing the document. \cs{requiresVersion} +% uses \cmd{\addToDocOpen}. If you want to combine several actions, including a version requirement +% you''ll have to use \cmd{\addToDocOpen}. Usage: +%\begin{verbatim} +% \requiresVersion{7} +%\end{verbatim} +% \begin{macro}{\alternateDocumentURL} +% An URL to direct the user to, it is used by \cmd{requiresVersion} when the version requirement +% is not met. +% \begin{macro}{\requiredVersionMsg} +% \cs{requireVersionMsg} is the message that is displayed when the version condition is not met. +% \begin{macro}{\requiredVersionMsgRedirect} +% An redirect message when the version requirement fails, and the document is in a browser. +% \begin{macro}{\afterRequirementPassedJS} +% A hook into the end of the \cmd{\requiresVersion} command for additional JS to be +% executed. +% \begin{macrocode} +\let\aeb@addOpenAction\@empty +\let\aeb@addActionCode\@empty +\let\aeb@addOpenActionArg\@empty +\def\AEB@psMrk{[\space} +\let\aebpopentoks\@empty +\let\aebpFA\aebp@NO +\def\aebp@rightDelimiters{} +% \end{macrocode} +% \begin{macro}{\addToDocOpen} +% The argument of \cmd{\addToDocOpen} is an action, usually +% JavaScript or named. +%\begin{verbatim} +% \addToDocOpen{/S/GoTo/D[\Page{2}/Fit]} +% \addToDocOpen{\JS{console.println("Public: Open it baby!");}} +%\end{verbatim} +% As of 2015/06/15, the original version of \cs{addToDocOpen} was moved to +% \textsf{insdljs} (v2.1). This redefinition extends that capability slightly +% by incorporating into it the \cs{dev@addToDocOpen} command, see definition +% below. +% \changes{v1.9}{2016/03/03}{Redefine \string\cs{addtoDocOpen} only for pdfmarkup} +% \par\medskip\noindent +% The \cmd{\addToDocOpen} command is the major interface +% between the document author for inserting open actions (not first page actions). +% At least in the case of \textsf{pdflatex}, \textsf{hyperref} has the potential of +% overwriting the user's choices with its own choice. We turn off the open page +% action of \textsf{hyperref} by setting the following two commands to empty. +% \begin{macrocode} +\let\@pdfstartview\@empty +\let\@pdfstartpage\@empty +% \end{macrocode} +% Now for the definition of \cmd\addToDocOpen. +% \changes{v2.1}{2016/05/15}{Finalized changes to \string\cs{addToDocOpen} for +% non-Distiller workflows.} +% \begin{macrocode} +\renewcommand{\addToDocOpen}[1]{% +% \end{macrocode} +% The \cs{aebpFA} flag indicates whether this command has been used. The first it is +% used, we set things up. +% \begin{macrocode} + \ifx\aebpFA\aebp@NO + \gdef\aeb@addOpenActionArg{#1}% + \g@addto@macro\aebpopentoks{#1}% + \def\aeb@addActionCode{\bgroup\makeJSspecials\dl@preProcDefns +\ifpdfmarkup + \literalps@out{\AEB@psMrk/_objdef {pubAddToDocOpen} + /type/dict /OBJ pdfmark^^J% + \AEB@psMrk{pubAddToDocOpen} + << \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters + >> /PUT pdfmark}% + \gdef\pubAddToDocOpen{{pubAddToDocOpen}}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\else\ifpdf + \immediate\pdfobj{<< \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters + >>}\xdef\pubAddToDocOpen{\the\pdflastobj\space 0 R}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\else\ifxetex + \immediate\@pdfm@mark{obj @pubAddToDocOpen << \aebpopentoks + \ifx\dev@addOpenAction\@empty\else + \ifx\aeb@addOpenActionArg\@empty\else^^J% + \dev@addOpenAction\fi\fi\aebp@rightDelimiters >> }% + \gdef\pubAddToDocOpen{@pubAddToDocOpen}% + \xdef\aeb@addOpenAction{/Next \pubAddToDocOpen}% +\fi\fi\fi\egroup}% +% \end{macrocode} +% Set the \cs{aebpFA} flag to \cs{aebp@YES} to indicate this command has been executed +% at least once. +% \begin{macrocode} + \global\let\aebpFA\aebp@YES + \else +% \end{macrocode} +% If the document author uses this command a second time, the code goes to here. +% \begin{macrocode} + \edef\aebp@dljstmp{\aebp@rightDelimiters}% + \xdef\aebp@rightDelimiters{\aebp@dljstmp >> }% + \g@addto@macro\aebpopentoks{/Next << #1 }% + \fi +} +\let\additionalOpenAction\addToDocOpen +% \end{macrocode} +% \end{macro} +% \begin{macro}{\dev@addToDocOpen} +% \changes{v1.7}{2015/06/07}{Added private additional action} +% The \cs{dev@addToDocOpen} is similar to +% \cs{addToDocOpen} but is meant for package developers. These actions are executed +% \emph{after the actions} of \cs{addToDocOpen}. +% \changes{v2.1}{2016/05/15}{Extended \string\cs{dev@addToDocOpen} to include +% non-Distiller workflows.} +% \begin{macrocode} +\let\dev@addOpenAction\@empty +\let\dev@addOpenActionArg\@empty +\let\dev@addActionCode\@empty +\let\aebpFAP\aebp@NO +\let\aebpopentoksP\@empty +\def\aebp@rightDelimitersP{} +\newcommand{\dev@addToDocOpen}[1]{% +% \end{macrocode} +% The \cs{aebpFAP} flag indicates whether this command has been used. The first it is +% used, we set things up. +% \begin{macrocode} + \ifx\aebpFAP\aebp@NO + \gdef\dev@addOpenActionArg{#1}% + \g@addto@macro\aebpopentoksP{#1}% + \def\dev@addActionCode{\bgroup\makeJSspecials\dl@preProcDefns +\ifpdfmarkup + \literalps@out{\AEB@psMrk/_objdef {privAddDocOpen} + /type/dict /OBJ pdfmark^^J% + \AEB@psMrk{privAddDocOpen} << \aebpopentoksP + \aebp@rightDelimitersP\space>> /PUT pdfmark}% + \gdef\privAddDocOpen{{privAddDocOpen}}% + \gdef\dev@addOpenAction{/Next {privAddDocOpen}}% +\else\ifpdf + \immediate\pdfobj{<< \aebpopentoksP + \aebp@rightDelimitersP\space>>}% + \xdef\privAddDocOpen{\the\pdflastobj\space 0 R}% + \xdef\dev@addOpenAction{/Next \privAddDocOpen}% +\else\ifxetex + \immediate\@pdfm@mark{obj @privAddToDocOpen << \aebpopentoksP + \aebp@rightDelimitersP\space>> }% + \gdef\privAddDocOpen{@privAddToDocOpen}% + \gdef\dev@addOpenAction{/Next \privAddDocOpen}% +\fi\fi\fi\egroup}% +% \end{macrocode} +% Set the \cs{aebpFAP} flag to \cs{aebp@YES} to indicate this command has been executed +% at least once. +% \begin{macrocode} + \global\let\aebpFAP\aebp@YES +% \end{macrocode} +% If the package developer uses this command a second time, the code goes to here. +% \begin{macrocode} + \else + \edef\aebp@dljstmpP{\aebp@rightDelimitersP}% + \xdef\aebp@rightDelimitersP{\aebp@dljstmpP >> }% + \g@addto@macro\aebpopentoksP{/Next << #1 }% + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\def\aebp@warnonly{warnonly} +\newcommand{\aebp@app@title}{AcroTeX Message} +% \end{macrocode} +%\begin{verbatim} +% #1 = warnonly or empty +% #2 = version number +%\end{verbatim} +% \begin{macrocode} +\newcommand{\requiresVersion}[2][]{\def\aebp@argi{#1}% + \def\requiredVersionNumber{#2}\dev@addToDocOpen{\JS{% +\ifx\aebp@argi\aebp@warnonly + var warnOnly=true; +\else + var warnOnly=false; +\fi +% \end{macrocode} +% (2015/10/14) Inserted parentheses to prevent dvips from breaking lines within a string. +% \changes{v1.7n}{2015/10/14}{Inserted parentheses to prevent dvips from breaking lines within a string.} +% \begin{macrocode} + var reqVerMsgC=("\aeb@requiredVersionMsg\space") + + ((warnOnly) ? ("\aeb@reqVerMsgW") : ("\aeb@reqVerMsgC")); + var reqVerMsgR=("\aeb@requiredVersionMsgRedirect\space") + + ((warnOnly) ? ("\aeb@reqVerMsgW") : ("\aeb@reqVerMsgR")); + if( app.viewerVersion < #2 ) { + var viewerPassedReq=false; + try { + if (this.external) { + app.alert({cTitle:"\aebp@app@title", cMsg: reqVerMsgR}); + if (!warnOnly) { + if (app.viewerVersion >= 7.0) + app.launchURL("\aebAlternateDocumentURL"); + else + this.getURL("\aebAlternateDocumentURL",false); + } + } else { + app.alert({cTitle:"\aebp@app@title", cMsg: reqVerMsgC}); + if (!warnOnly) this.closeDoc(true); + } + } catch(e) {} + } else { + var viewerPassedReq=true; + \aeb@ViewerPassedRequirementJS + } +}}} +\def\requiredVersionNumber{7} +\newcommand{\alternateDocumentURL}[1]{\def\aebAlternateDocumentURL{#1}} +\alternateDocumentURL{http://www.acrotex.net/} +\newcommand{\requiredVersionMsg}[1]{\def\aeb@requiredVersionMsg{#1}} +\requiredVersionMsg{This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later.} +\newcommand{\requiredVersionResult}[3]{\def\aeb@reqVerMsgC{#1}% + \def\aeb@reqVerMsgR{#2}\def\aeb@reqVerMsgW{#3}} +\requiredVersionResult{The document is now closing.} + {Redirecting browser to an alternate page.} + {Some features of this document may not work properly.} +\newcommand{\requiredVersionMsgRedirect}[1]{% + \def\aeb@requiredVersionMsgRedirect{#1}} +\requiredVersionMsgRedirect{% + This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later.} +\newcommand{\afterRequirementPassedJS}[1]{% + \def\aeb@ViewerPassedRequirementJS{#1}} +\let\aeb@ViewerPassedRequirementJS\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% Now let's put it all together. The two flags, \cs{aebpFA} and \cs{aebpFAP} indicate +% whether the commands \cs{addToDocOpen} and \cs{dev@addToDocOpen} were used. +% \begin{macrocode} +\def\aeb@SetCatalog{% + \ifx\aebpFA\aebp@NO\addToDocOpen{\JS{;}}\fi + \ifx\aebpFAP\aebp@YES\dev@addActionCode\fi + \aeb@addActionCode +% \end{macrocode} +% The viewer preferences. +% \begin{macrocode} +\def\aeb@CatEntry{/ViewerPreferences<<% + \ifx\aeb@windowoptsFitWindow\@empty\else + \aeb@windowoptsFitWindow\fi + \ifx\aeb@windowoptsCenterWindow\@empty\else + \aeb@windowoptsCenterWindow\fi + \ifx\aeb@windowoptsDisplayDocTitle\@empty\else + \aeb@windowoptsDisplayDocTitle\fi + \ifx\aeb@uioptsHideToolbar\@empty\else + \aeb@uioptsHideToolbar\fi + \ifx\aeb@uioptsHideMenubar\@empty\else + \aeb@uioptsHideMenubar\fi + \ifx\aeb@uioptsHideWindowUI\@empty\else + \aeb@uioptsHideWindowUI\fi + \ifx\aeb@layoutMagNaviTab\@empty\else + /NonFullScreenPageMode/\aeb@layoutMagNaviTab\fi +>>% + \ifx\aeb@TaggedPDF\@empty\else + /MarkInfo<</Marked true>>\fi + \ifx\aeb@layoutMagPageLayout\@empty\else + /PageLayout/\aeb@layoutMagPageLayout\fi + \ifx\aeb@windowoptsFullScreen\@empty + \ifx\aeb@layoutMagNaviTab\@empty\else + /PageMode/\aeb@layoutMagNaviTab\fi + \else/PageMode/FullScreen\fi +% \end{macrocode} +% The open action key (\textsf{\textbf{OpenAction}}) is implemented any of three ways, +% depending on the driver. The command \cs{pubAddToDocOpen} is an indirect reference +% to additional open actions; this is defined in \cs{addToDocOpen}. +%\changes{v1.9}{2016/03/03}{Removing pdfmark code for non-Distiller workflow} +% \begin{macrocode} +\ifpdfmarkup + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction<</D[{Page1}\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<</D[{\aeb@layoutMagPage}/Fit]% + /S/GoTo\aeb@addOpenAction>>\else + /OpenAction<</D[{\aeb@layoutMagPage}\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \fi +\else\ifpdf + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction <<% + /D[\pdfpageref1\space\space 0 R\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<</D[\expandafter + \pdfpageref\aeb@layoutMagPage\space\space 0 R/Fit]% + /S/GoTo\aeb@addOpenAction>>\else + /OpenAction<</D[\expandafter\pdfpageref + \aeb@layoutMagPage\space\space 0 R\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \fi +\else\ifxetex + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction<</D[@page1 \aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<</D[@page\aeb@layoutMagPage\space/Fit]% + /S/GoTo\aeb@addOpenAction>>\else + /OpenAction<<% + /D[@page\aeb@layoutMagPage\space\aeb@layoutMagMag]% + /S/GoTo\aeb@addOpenAction>>\fi + \fi +\fi\fi\fi}% +% \end{macrocode} +% Load \cs{aeb@SetCatalog} only if a Distiller user. +%\changes{v1.9}{2016/03/03}{Removing pdfmark code for non-Distiller workflow} +%\changes{v2.0}{2016/05/08}{Attempt to extend package to include more features +%for pdftex and xetex. Modified \string\cs{aeb@SetCatalog}.} +% \begin{macrocode} + \ifpdfmarkup\literalps@out{\AEB@psMrk{Catalog} + <<\aeb@CatEntry>> /PUT pdfmark}\else + \ifpdf\pdfcatalog{\aeb@CatEntry}\else + \ifxetex\immediate\@pdfm@mark{put @catalog <<\aeb@CatEntry>>}% + \fi\fi\fi +} +\AtBeginDocument{\aeb@SetCatalog} +% \end{macrocode} +% +% \section{Fullscreen and Transitions} +% +% \subsection{\texorpdfstring{\cs{setDefaultFS}}{\textbackslash setDefaultFS}} +% \begin{macro}{\setDefaultFS} +% Use \cs{setDefaultFS} to set the defaults for fullscreen +% mode in the Adobe Reader or Acrobat. +% \begin{macrocode} +\newcommand{\setDefaultFS}[1] +{% + \setkeys{aebDefFS}{Trans=Replace}\setkeys{aebDefFS}{#1}% + \makeatletter + \InputIfFileExists{fsprodef.js}{}{\PackageWarning{aeb_pro} + {Cannot find fsprodef.js, please run aeb_pro.ins again}} + \makeatother +} +\@onlypreamble\setDefaultFS +% \end{macrocode} +% \end{macro} +% Definitions of the values of the \texttt{Trans}\IndexKey{Trans} key for +% supported transitions; these are set using the command +% \cs{setDefaultFS}. +% +% \begin{macrocode} +\def\aeb@NoTransition{NoTransition} +\define@choicekey+{aebDefFS}{Trans} +{NoTransition,UncoverLeft,UncoverRight,UncoverDown,UncoverUp,% +UncoverLeftDown,UncoverLeftUp,UncoverRightDown,UncoverRightUp,% +CoverLeft,CoverRight,CoverDown,CoverUp,CoverLeftDown,CoverLeftUp,% +CoverRightDown,CoverRightUp,PushLeft,PushRight,PushDown,PushUp,% +PushLeftDown,PushLeftUp,PushRightDown,PushRightUp,FlyInRight,% +FlyInLeft,FlyInDown,FlyInUp,FlyOutRight,FlyOutLeft,FlyOutDown,% +FlyOutUp,FlyIn,FlyOut,Blend,Fade,Random,Dissolve,% +GlitterRight,GlitterDown,GlitterRightDown,BoxIn,BoxOut,% +BlindsHorizontal,BlindsVertical,SplitHorizontalIn,% +SplitHorizontalOut,SplitVerticalIn,SplitVerticalOut,WipeLeft,% +WipeRight,WipeDown,WipeUp,WipeLeftDown,WipeLeftUp,% +WipeRightDown,WipeRightUp,Replace,ZoomInDown,ZoomInLeft,% +ZoomInLeftDown,ZoomInLeftUp,ZoomInRight,ZoomInRightDown,% +ZoomInRightUp,ZoomInUp,ZoomOutDown,ZoomOutLeft,ZoomOutLeftDown,% +ZoomOutLeftUp,ZoomOutRight,ZoomOutRightDown,ZoomOutRightUp,% +ZoomOutUp,CombHorizontal,CombVertical}[Replace]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fsTran\@empty\else + \ifx\aeb@arg\aeb@NoTransition + \def\aeb@fsTran{app.fs.defaultTransition = "";^^J} + \else + \def\aeb@fsTran{app.fs.defaultTransition = "#1";^^J}\fi\fi} +{\PackageWarning{aeb}{Bad choice, try again. Meanwhile, + will use the default, Replace}% + \def\aeb@fsTran{app.fs.defaultTransition = "Replace";^^J}} +% \end{macrocode} +% The \texttt{bgColor}\IndexKey{bgColor} key. +% \begin{macrocode} +\define@key{aebDefFS}{bgColor}[]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fsBGColor\@empty\else + \def\aeb@fsBGColor{app.fs.backgroundColor = #1;^^J}\fi} +\let\aeb@fsBGColor\@empty +% \end{macrocode} +% The \texttt{timeDelay}\IndexKey{timeDelay} key. +% \begin{macrocode} +\define@key{aebDefFS}{timeDelay}[]{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fstimeDelay\@empty\else + \def\aeb@fstimeDelay{app.fs.timeDelay = #1;^^J}\fi} +\let\aeb@fstimeDelay\@empty +% \end{macrocode} +% The \texttt{loop}\IndexKey{loop} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{loop}[true]{% + \def\aeb@fsLoop{app.fs.loop = #1;^^J}} +\let\aeb@fsLoop\@empty +% \end{macrocode} +% The \texttt{cursor}\IndexKey{cursor} key. +% \begin{macrocode} +\define@choicekey+{aebDefFS}{cursor}{hidden,delay,visible}{% + \def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@fscursor\@empty\else + \def\aeb@fscursor{app.fs.cursor = cursor.#1;^^J}\fi +}{\PackageWarning{aeb}{Bad choice for cursor, permissible values + are hidden, delay and visible. Try again}} +\let\aeb@fscursor\@empty +% \end{macrocode} +% The \texttt{escape}\IndexKey{escape} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{escape}[true]{% + \def\aeb@fsEscape{app.fs.escapeExits = #1;^^J}} +\let\aeb@fsEscape\@empty +% \end{macrocode} +% The \texttt{clickAdv}\IndexKey{clickAdv} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{clickAdv}[true]{% + \def\aeb@fsclickAdv{app.fs.clickAdvances = #1;^^J}} +\let\aeb@fsclickAdv\@empty +% \end{macrocode} +% The \texttt{fullscreen}\IndexKey{fullscreen} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{fullscreen}[true]{% + \def\aeb@windowoptsFullScreen{true}% +} +\let\aeb@fsFS\@empty +% \end{macrocode} +% The \texttt{useTimer}\IndexKey{useTimer} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{useTimer}[true]{% + \def\aeb@fsuseTimer{app.fs.useTimer = #1;^^J}} +\let\aeb@fsuseTimer\@empty +% \end{macrocode} +% The \texttt{usePageTiming}\IndexKey{usePageTiming} key. +% \begin{macrocode} +\define@boolkey{aebDefFS}{usePageTiming}[true]{% + \def\aeb@fsusePageTiming{app.fs.usePageTiming = #1;^^J}} +\let\aeb@fsusePageTiming\@empty +% \end{macrocode} +% \subsection{\texorpdfstring{\cs{setPageTransition}}{\textbackslash setPageTransition}} +% +% \begin{macro}{\setPageTransition} +% By setting the \texttt{aebTrans} family of keys, you can change the transition +% effect of the next slide. +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{setPageTransition} for +% non-Distiller workflows.} +% \begin{macrocode} +\def\aebp@PageTransCnt{0} +\def\aebp@Step@PageTransCnt{{\count0=\aebp@PageTransCnt\relax + \advance\count0by1\relax + \xdef\aebp@PageTransCnt{\the\count0 }}} +\newcommand{\setPageTransition}[1]{% + \begingroup + \aebp@Step@PageTransCnt + \setkeys{aebTrans}{TransDur,Speed,#1}% + \edef\aeb@pagetranschoices{\aeb@Page@Dur + /Trans <<\aeb@Trans@Dur\aeb@TranChoice>>}% + \csarg{\xdef}{aeb@pagetransCodeL\aebp@PageTransCnt}{% + \ifpdfmarkup + \noexpand\literalps@out{\AEB@psMrk{ThisPage} << + \aeb@pagetranschoices\space>> /PUT pdfmark}% + \else\ifpdf +% \end{macrocode} +% There may be open / close page actions already defined, so we combine +% previous page actions with current page actions. This seems necessary +% only for \textsf{pdftex}. +% \begin{macrocode} + \noexpand\global\noexpand\pdfpageattr=\noexpand\expandafter + {\noexpand\the\noexpand\pdfpageattr\aeb@pagetranschoices}% + \else\ifxetex + \noexpand\immediate\noexpand\@pdfm@mark{put @thispage << + \aeb@pagetranschoices\space >>} + \fi\fi\fi + } + \ifx\aeb@TranChoice\@empty\else + \csarg\xdef{aebpP@geTr@nsP@ge\arabic{page}}% + {\noexpand\@nameuse{aeb@pagetransCodeL\aebp@PageTransCnt}}% + \fi + \endgroup +} +% \end{macrocode} +% \begin{macro}{\setPageTransitionAt} +% Set the transition for a particular page +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{setPageTransitionAt} for +% non-Distiller workflows.} +% \begin{macrocode} +\newcommand{\setPageTransitionAt}[2]{% + \begingroup + \aebp@Step@PageTransCnt + \setkeys{aebTrans}{#2}% + \edef\aeb@pagetranschoices{\aeb@Page@Dur + /Trans <<\aeb@Trans@Dur\aeb@TranChoice>>}% + \csarg{\xdef}{aeb@pagetransCode\aebp@PageTransCnt}{% + \ifpdfmarkup + \noexpand\literalps@out{\AEB@psMrk{ThisPage} << + \aeb@pagetranschoices\space>> /PUT pdfmark}% + \else\ifpdf +% \end{macrocode} +% There may be open / close page actions already defined, so we combine +% previous page actions with current page actions. This seems necessary +% only for \textsf{pdftex}. +% \begin{macrocode} + \noexpand\global\noexpand\pdfpageattr=\noexpand\expandafter + {\noexpand\the\noexpand\pdfpageattr\aeb@pagetranschoices}% + \else\ifxetex + \noexpand\immediate\noexpand\@pdfm@mark{put @thispage << + \aeb@pagetranschoices\space>>} + \fi\fi\fi + } + \ifx\aeb@TranChoice\@empty\else + \expandafter\aebp@rse\expandafter{#1}% + \edef\shakeandbake{% + \noexpand\@for\noexpand\@mypage:=\the\aeb@parsetoks}% + \shakeandbake \do {% + \csarg\xdef{aebpP@geTr@nsP@ge\@mypage}% + {\noexpand\@nameuse{aeb@pagetransCode\aebp@PageTransCnt}}% + }% + \fi + \endgroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% The values of the \texttt{Trans}\IndexKey{Trans} key. There are the 50 transitions effects as listed by +% \texttt{app.fs.transitions} plus one more called +% ``\texttt{NoTransition}''. The \texttt{pdfmark} code accurately +% represents each of this options. +% \begin{macrocode} +\define@choicekey+{aebTrans}{Trans} +{NoTransition,UncoverLeft,UncoverRight,UncoverDown,UncoverUp,% +UncoverLeftDown,UncoverLeftUp,UncoverRightDown,UncoverRightUp,% +CoverLeft,CoverRight,CoverDown,CoverUp,CoverLeftDown,CoverLeftUp,% +CoverRightDown,CoverRightUp,PushLeft,PushRight,PushDown,PushUp,% +PushLeftDown,PushLeftUp,PushRightDown,PushRightUp,FlyInRight,% +FlyInLeft,FlyInDown,FlyInUp,FlyOutRight,FlyOutLeft,FlyOutDown,% +FlyOutUp,FlyIn,FlyOut,Blend,Fade,Random,Dissolve,% +GlitterRight,GlitterDown,GlitterRightDown,BoxIn,BoxOut,% +BlindsHorizontal,BlindsVertical,SplitHorizontalIn,% +SplitHorizontalOut,SplitVerticalIn,SplitVerticalOut,WipeLeft,% +WipeRight,WipeDown,WipeUp,WipeLeftDown,WipeLeftUp,% +WipeRightDown,WipeRightUp,Replace,ZoomInDown,ZoomInLeft,% +ZoomInLeftDown,ZoomInLeftUp,ZoomInRight,ZoomInRightDown,% +ZoomInRightUp,ZoomInUp,ZoomOutDown,ZoomOutLeft,ZoomOutLeftDown,% +ZoomOutLeftUp,ZoomOutRight,ZoomOutRightDown,ZoomOutRightUp,% +ZoomOutUp,CombHorizontal,CombVertical}[Replace]% + {\edef\aeb@TranChoice{\csname aeb@Trans@#1\endcsname}% +}{\PackageWarning{aeb}{Bad choice, try again}} +\let\aeb@TranChoice\@empty +\define@key{aebTrans}{TransDur}[]{\def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@Trans@Dur\@empty\else\def\aeb@Trans@Dur{/D #1}\fi} +\let\aeb@Trans@Dur\@empty +% \end{macrocode} +% Length\IndexKey{Speed} of duration of transition effect: \texttt{Slow}, \texttt{Medium}, \texttt{Fast} +% \begin{macrocode} +\define@choicekey+{aebTrans}{Speed}[\val\nr]% + {Slow,Medium,Fast}[Slow]{%dps/change 02/27/07 + \ifcase\nr\relax + \let\aeb@Trans@Speed\@empty\or + \def\aeb@Trans@Speed{/D 0.666656}\or + \def\aeb@Trans@Speed{/D 0.333328}\fi +}{\PackageWarning{aeb}{Bad choice for Speed, permissible values + are Slow, Medium and Fast. Try again}} +\let\apb@apbTrans@Speed\@empty +% \end{macrocode} +% The page duration\IndexKey{PageDur} key +% \begin{macrocode} +\define@key{aebTrans}{PageDur}[]{\def\aeb@arg{#1}\ifx\aeb@arg\@empty + \let\aeb@Page@Dur\@empty\else\def\aeb@Page@Dur{/Dur #1}\fi} +% \end{macrocode} +% The code for the values of the \texttt{Trans} key +% \begin{macrocode} +\let\aeb@Page@Dur\@empty +\def\aeb@Trans@NoTransition{} +\def\aeb@Trans@SplitHorizontalIn{/Dm/H/M/I/S/Split} +\def\aeb@Trans@SplitHorizontalOut{/Dm/H/M/O/S/Split} +\def\aeb@Trans@SplitVerticalIn{/Dm/V/M/I/S/Split} +\def\aeb@Trans@SplitVerticalOut{/Dm/V/M/O/S/Split} +\def\aeb@Trans@BlindsHorizontal{/Dm/H/S/Blinds} +\def\aeb@Trans@BlindsVertical{/Dm/V/S/Blinds} +\def\aeb@Trans@BoxIn{/M/I/S/Box} +\def\aeb@Trans@BoxOut{/M/O/S/Box} +\def\aeb@Trans@WipeLeft{/Di 180/S/Wipe} +\def\aeb@Trans@WipeRight{/Di 0/S/Wipe} +\def\aeb@Trans@WipeDown{/Di 270/S/Wipe} +\def\aeb@Trans@WipeUp{/Di 90/S/Wipe} +\def\aeb@Trans@Dissolve{/S/Dissolve} +\def\aeb@Trans@GlitterRight{/Di 0/S/Glitter} +\def\aeb@Trans@GlitterDown{/Di 270/S/Glitter} +\def\aeb@Trans@GlitterRightDown{/Di 315/S/Glitter} +\def\aeb@Trans@Replace{/S/R} +\def\aeb@Trans@FlyInRight{/Di 0/M/I/S/Fly} +\def\aeb@Trans@FlyInLeft{/Di 180/M/I/S/Fly} +\def\aeb@Trans@FlyInDown{/Di 270/M/I/S/Fly} +\def\aeb@Trans@FlyInUp{/Di 90/M/I/S/Fly} +\def\aeb@Trans@FlyOutRight{/Di 0/M/O/S/Fly} +\def\aeb@Trans@FlyOutLeft{/Di 180/M/O/S/Fly} +\def\aeb@Trans@FlyOutDown{/Di 270/M/O/S/Fly} +\def\aeb@Trans@FlyOutUp{/Di 90/M/O/S/Fly} +\def\aeb@Trans@FlyIn{/M/I/S/Fly} +\def\aeb@Trans@FlyOut{/M/O/S/Fly} +\def\aeb@Trans@PushLeft{/Di 180/S/Push} +\def\aeb@Trans@PushRight{/Di 0/S/Push} +\def\aeb@Trans@PushDown{/Di 270/S/Push} +\def\aeb@Trans@PushUp{/Di 90/S/Push} +\def\aeb@Trans@CoverLeft{/Di 180/S/Cover} +\def\aeb@Trans@CoverRight{/Di 0/S/Cover} +\def\aeb@Trans@CoverDown{/Di 270/S/Cover} +\def\aeb@Trans@CoverUp{/Di 90/S/Cover} +\def\aeb@Trans@CoverLeftDown{/Di 225.0/S/Cover} +\def\aeb@Trans@CoverLeftUp{/Di 135.0/S/Cover} +\def\aeb@Trans@CoverRightDown{/Di 315.0/S/Cover} +\def\aeb@Trans@CoverRightUp{/Di 45.0/S/Cover} +\def\aeb@Trans@UncoverLeft{/Di 180/S/Uncover} +\def\aeb@Trans@UncoverRight{/Di 0/S/Uncover} +\def\aeb@Trans@UncoverDown{/Di 270/S/Uncover} +\def\aeb@Trans@UncoverUp{/Di 90/S/Uncover} +\def\aeb@Trans@UncoverLeftDown{/Di 225.0/S/Uncover} +\def\aeb@Trans@UncoverLeftUp{/Di 135.0/S/Uncover} +\def\aeb@Trans@UncoverRightDown{/Di 315.0/S/Uncover} +\def\aeb@Trans@UncoverRightUp{/Di 45.0/S/Uncover} +\def\aeb@Trans@Fade{/S/Fade} +\def\aeb@Trans@Random{/S/Random} +\def\aeb@Trans@Blend{/S/Blend} +% \end{macrocode} +% New Transitions for Acrobat 8.0 +% \begin{macrocode} +\def\aeb@Trans@PushLeftDown{% + /S/Push/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@PushLeftUp{% + /S/Push/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@PushRightDown{% + /S/Push/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@PushRightUp{% + /S/Push/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@WipeLeftDown{% + /S/Wipe/Directional/BiDir/Di 225/Curve/Easy} +\def\aeb@Trans@WipeLeftUp{% + /S/Wipe/Directional/BiDir/Di 135/Curve/Easy} +\def\aeb@Trans@WipeRightDown% + {/S/Wipe/Directional/BiDir/Di 315/Curve/Easy} +\def\aeb@Trans@WipeRightUp{% + /S/Wipe/Directional/BiDir/Di 45/Curve/Easy} +\def\aeb@Trans@ZoomInDown{% + /S/ZoomIn/Directional/BiDir/Di 270.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeft{% + /S/ZoomIn/Directional/BiDir/Di 180.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeftDown{% + /S/ZoomIn/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@ZoomInLeftUp{% + /S/ZoomIn/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@ZoomInRight{% + /S/ZoomIn/Directional/BiDir/Di 0.0/Curve/Easy} +\def\aeb@Trans@ZoomInRightDown{% + /S/ZoomIn/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@ZoomInRightUp{% + /S/ZoomIn/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@ZoomInUp{% + /S/ZoomIn/Directional/BiDir/Di 90.0/Curve/Easy} +\def\aeb@Trans@ZoomOutDown{% + /S/ZoomOut/Directional/BiDir/Di 270.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeft{% + /S/ZoomOut/Directional/BiDir/Di 180.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeftDown{% + /S/ZoomOut/Directional/BiDir/Di 225.0/Curve/Easy} +\def\aeb@Trans@ZoomOutLeftUp{% + /S/ZoomOut/Directional/BiDir/Di 135.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRight{% + /S/ZoomOut/Directional/BiDir/Di 0.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRightDown{% + /S/ZoomOut/Directional/BiDir/Di 315.0/Curve/Easy} +\def\aeb@Trans@ZoomOutRightUp{% + /S/ZoomOut/Directional/BiDir/Di 45.0/Curve/Easy} +\def\aeb@Trans@ZoomOutUp{% + /S/ZoomOut/Directional/BiDir/Di 90.0/Curve/Easy} +\def\aeb@Trans@CombHorizontal{% + /S/Comb/Directional/BiDir/Dm/H/Curve/Easy} +\def\aeb@Trans@CombVertical{% + /S/Comb/Directional/BiDir/Dm/V/Curve/Easy} +% \end{macrocode} +% \begin{macrocode} +% End of aebpro segment +%</aebpro> +%<*fsdefjs> +% \end{macrocode} +% \subsection{JS for Fullscreen Support} +% The ``Presentation Defaults'' are used in conjunction with the +% \cs{setDefaultFS} for setting the defaults of the application. These +% settings can be viewed under the \texttt{Edit > Preferences > +% General > Full Screen}. This script save the viewers preferences, +% sets them according the needs of the document author, and upon +% closing the document, resets the original preferences. The last task +% is performed by the \texttt{willClose} environment. +% \begin{macrocode} +\begin{insDLJS}[_fsDefaults]{fsdef}{AeB Pro: Presentation Defaults} +var _fsDefaults = true; +%if ( typeof global.fsexec == "undefined" ) +if ( typeof fsexec == "undefined" ) +{ + try { + var fsexec = true; +% global.fsexec = true; + var aebdefaultTransition = app.fs.defaultTransition; + var aebbackgroundColor = app.fs.backgroundColor; + var aebloop = app.fs.loop; + var aebtimeDelay = app.fs.timeDelay; + var aebuseTimer = app.fs.useTimer + var aebusePageTiming = app.fs.usePageTiming; + var aebclickAdvances = app.fs.clickAdvances; + var aebcursor = app.fs.cursor; + var aebescapeExits = app.fs.escapeExits; +\aeb@fsTran% +\aeb@fsBGColor% +\aeb@fsLoop% +\aeb@fsclickAdv% +\aeb@fscursor% +\aeb@fstimeDelay% +\aeb@fsuseTimer% +\aeb@fsusePageTiming% +\aeb@fsEscape% +\aeb@fsFS% + } catch(e) {} +} +\end{insDLJS} +% \end{macrocode} +% This is a series of script lines that will be inserted into the \texttt{willClose} +% section of the document. These will attempt to restore the user's full screen +% defaults. +% \begin{macrocode} +\begin{fs@willClose} +try { + delete global.fsexec; + app.fs.defaultTransition = aebdefaultTransition; + app.fs.backgroundColor = aebbackgroundColor; + app.fs.loop = aebloop; + app.fs.timeDelay = aebtimeDelay; + app.fs.useTimer = aebuseTimer; + app.fs.usePageTiming = aebusePageTiming; + app.fs.clickAdvances = aebclickAdvances; + app.fs.cursor = aebcursor; + app.fs.escapeExits = aebescapeExits; +} catch(e) { console.println("Could not reset one of the defaults"); } +\end{fs@willClose} +% \end{macrocode} +% \begin{macrocode} +% End of fsdefjs segment +%</fsdefjs> +%<*aebpro> +% \end{macrocode} +% \section{Set Page Actions} +% \begin{environment}{addJSToPageOpen} +% \begin{environment}{addJSToPageOpenAt} +% \begin{environment}{addJSToPageClose} +% \begin{environment}{addJSToPageCloseAt} +% The document author can add to the default page open action through +% this environment. Use this environment between slides, effective +% the next slide. The first slide (possibly generated by +% \cs{maketitle}) is a special case: When setting the open and close +% page actions for the first page, these environments \emph{must go} +% in the preamble. +% \begin{macrocode} +\def\canceleveryPageOpen{\global\@everyPageOpenfalse + \global\let\every@PageOpen\@empty} +\def\canceleveryPageClose{\global\@everyPageClosefalse + \global\let\every@PageClose\@empty} +\newenvironment{everyPageOpen}[1][] +{\global\@everyPageOpentrue\@defineJS[#1]{\every@PageOpen}} +{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoOpenJS{\thisPageAction{\JS{\every@PageOpen}}{}}% + \expandafter\aftergroup\expandafter\ap@AddtoOpenJS\fi +} +\newenvironment{everyPageClose}[1][] +{\global\@everyPageClosetrue\@defineJS[#1]{\every@PageClose}} +{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoCloseJS{\thisPageAction{}{\JS{\every@PageClose}}}% + \expandafter\aftergroup\expandafter\ap@AddtoCloseJS\fi +} +\let\every@PageOpen\@empty +\let\every@PageClose\@empty +\newenvironment{addJSToPageOpen}[1][] +{\@defineJS[#1]{\addJST@PageOpen}}{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoOpenJS{\thisPageAction{\JS{\addJST@PageOpen}}{}}% + \expandafter\aftergroup\expandafter\ap@AddtoOpenJS\fi +} +\newenvironment{addJSToPageOpenAt}[2][] +{\@@defineJS[#1]{addJST@PageOpenAt}{#2}}{\end@@defineJS +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{\texttt{addJSToPageOpenAt} can now be used in preamble} +% The \texttt{addJSToPageOpenAt} and \texttt{addJSToPageCloseAt} can now be used +% in the preamble on the first page. +% \begin{macrocode} + \ifnum\value{page}=1\relax\if\frstPageSpec\aebp@YES + \thisPageAction{\JS{\@nameuse{addJST@PageOpenAt1}}}{}\fi\fi +} +\newenvironment{addJSToPageClose}[1][] +{\@defineJS[#1]{\addJST@PageClose}}{\end@defineJS + \ifnum\value{page}=1\relax + \gdef\ap@AddtoCloseJS{% + \thisPageAction{}{\JS{\addJST@PageClose}}}% + \expandafter\aftergroup\expandafter\ap@AddtoCloseJS\fi +} +\newenvironment{addJSToPageCloseAt}[2][] +{\@@defineJS[#1]{addJST@PageCloseAt}{#2}}{\end@@defineJS + \ifnum\value{page}=1\relax\if\frstPageSpec\aebp@YES + \thisPageAction{}{\JS{\@nameuse{addJST@PageCloseAt1}}}\fi\fi +} +\let\addJST@PageOpen\@empty +\let\addJST@PageClose\@empty +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \begin{macro}{\aebp@PageOpenCloseHandler} +% This command gets expanded by \cs{AddToShipoutPicture} for each page. Here we +% define how our page actions are to be inserted. +% \begin{macrocode} +\def\aebp@PageOpenCloseHandler{% + \@ifundefined{addJST@PageOpenAt\arabic{page}}% + {\global\let\thisOpenPageActionAt\@empty}% + {\gdef\thisOpenPageActionAt{% + \@nameuse{addJST@PageOpenAt\arabic{page}}}}% + \@ifundefined{addJST@PageCloseAt\arabic{page}}% + {\global\let\thisClosePageActionAt\@empty}% + {\gdef\thisClosePageActionAt{% + \@nameuse{addJST@PageCloseAt\arabic{page}}}}% + \aebPageAction{\thisOpenPageActionAt\addJST@PageOpen}% + {\thisClosePageActionAt\addJST@PageClose}% + \global\let\addJST@PageOpen\@empty + \global\let\addJST@PageClose\@empty +} +% \end{macrocode} +% (2016/05/15) Added \cs{aebp@PageTransHandler} to handle the page +% transitions. +% \changes{v2.1}{2016/05/15}{Added the command \string\cs{aebp@PageTransHandler} to handle the page +% transitions} +% \begin{macrocode} +\def\aebp@PageTransHandler{\@ifundefined{aebpP@geTr@nsP@ge\arabic{page}} + {}{\@nameuse{aebpP@geTr@nsP@ge\arabic{page}}}} +% \end{macrocode} +% The two handlers are executed on each page +% \changes{v2.1}{2016/05/15}{Added the command \string\cs{aebp@PageTransHandler} +% to the shipout cmd \string\cs{AddToShipoutPicture}.} +% \begin{macrocode} +\AddToShipoutPicture{\aebp@PageOpenCloseHandler + \aebp@PageTransHandler} +% \end{macrocode} +% \end{macro} +% \DescribeMacro{\@@defineJS} is a variation of \cs{@defineJS}, as defined in the \textsf{insdljs} package. +% This version, at the end of the environment, calls the \cs{aebp@rse} command to parse the +% complex command argument, then makes a series of definitions to be used in the open/close +% page events. +% \begin{macrocode} +\newenvironment{@@defineJS}[3][] +{% + \gdef\argType{#2}\gdef\defineJSArg{#3}\JStoks={}% + \def\verbatim@processline + {% + \xdef\JS@temp{\the\JStoks\the\verbatim@line\defineJSjsR}% + \global\JStoks=\expandafter{\JS@temp}% + }% + \let\do\@makeother\dospecials\catcode`\^^M\active + #1% + \verbatim@start +}{% + \expandafter\aebp@rse\expandafter{\defineJSArg}% + \edef\shakeandbake{% + \noexpand\@for\noexpand\@mytoks:=\the\aeb@parsetoks}% + \aeb@parsecnt=0 \shakeandbake \do {% + \ifnum\aeb@parsecnt=0 + \edef\firsttok{\@mytoks}% + \csarg\xdef{\argType\@mytoks}{\the\JStoks}% + \else + \edef\letsmakelet{\global\let\expandafter\noexpand + \csname\argType\@mytoks\endcsname=\expandafter\noexpand + \csname\argType\firsttok\endcsname}% + \letsmakelet + \fi + \advance\aeb@parsecnt1\relax + }% +} +% \end{macrocode} +% \begin{macrocode} +\newif\ifaeb@PageOpen +\newif\ifaeb@PageClose +\newif\if@everyPageOpen\@everyPageOpenfalse +\newif\if@everyPageClose\@everyPageClosefalse +% \end{macrocode} +% \begin{macro}{\aebPageAction} +% This is used internally, but can be used by the document author. The commands creates the code +% to set an open page and a close page action. The first (optional) argument is a the page number (base 1), +% this optional argument defaults to the current page if no page number is given. The second and third +% arguments are the open and closed JavaScript actions. +% +% If the document author uses this command, he may overwrite actions created by the \texttt{addJSTo...} +% environments. See \cs{aeb@addToPageOpenCloseActions} for usage by this package. +% \changes{v2.1}{2016/05/15}{Final changes to \string\cs{aebPageAction} to include non-Distiller +% workflows.} +% \begin{macrocode} +\newcommand\aebPageAction[3][ThisPage]{% + \let\ispageactions=0\aeb@PageOpenfalse\aeb@PageClosefalse + \def\@aebOpen{#2}% + \if1\@aebOpen1% + \if@everyPageOpen + \aeb@PageOpentrue\let\ispageactions=1% + \def\@aebOpen{/O << \JS{\every@PageOpen#2} >>}% + \fi + \else + \let\ispageactions=1% + \aeb@PageOpentrue + \def\@aebOpen{/O << \JS{\every@PageOpen#2} >>}% + \fi + \def\@aebClose{#3}% + \if1\@aebClose1% + \if@everyPageClose + \aeb@PageClosetrue\let\ispageactions=1% + \def\@aebClose{/C << \JS{\every@PageClose#3} >>}% + \fi + \else + \let\ispageactions=1% + \aeb@PageClosetrue + \def\@aebClose{/C << \JS{\every@PageClose#3} >>}% + \fi + \if@everyPageOpen\aeb@PageOpentrue\let\ispageactions=1\fi + \if@everyPageClose\@everyPageClosetrue\let\ispageactions=1\fi + \if\ispageactions1% + \xdef\aebp@PageActionCode{/AA << + \ifaeb@PageOpen\@aebOpen\space\fi + \ifaeb@PageClose\@aebClose\space\fi >>} +% \end{macrocode} +% For page 1, the open page is handled by \textsf{insdljs} +% \changes{v2.0a}{2016/05/11}{Let \string\textsf{insdljs} handle page open +% for page 1.} +% \begin{macrocode} + \ifnum\value{page}=1\relax\else + \ifpdfmarkup\literalps@out{\AEB@psMrk{#1} << + \aebp@PageActionCode\space >> /PUT pdfmark}\else + \ifpdf\global\pdfpageattr=\expandafter + {\aebp@PageActionCode}\else + \ifxetex\@pdfm@mark{put @thispage << + \aebp@PageActionCode\space>>}\fi\fi\fi + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\atPage} +% \cs{atPage} is a modification of \cs{pageref}, so its value will always be an integer. +% returned in the token register \cs{aeb@parsetoks}. Used in the arguments of such environments +% as \texttt{addJSToPageOpenAt} and \texttt{addJSToPageCloseAt}. +% \begin{macrocode} +\def\aeb@exiii{\expandafter\expandafter\expandafter} +\let\ahrefexafter\aeb@exiii +\def\atPage#1{\@ifundefined{r@#1}{1} + {\aeb@exiii\@secondoffive\csname r@#1\endcsname}} +\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start} + {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}} +% \end{macrocode} +% \end{macro} +% The command \cs{aebp@rse} parses such arguments as +%\begin{verbatim} +% {1,3,4-6,8-12,15,\atPage{firstlabel}-\atPage{secondlabel},30-} +%\end{verbatim} +% The expanded list is returned in the token register \cs{aeb@parsetoks}. +% \begin{macrocode} +\newtoks\aeb@parsetoks +\newcount\aeb@parsecnt +\def\ap@gobtonil#1\@nil{} +\def\ap@gettonil#1\@nil{\def\to@nilarg{#1}} +\def\ap@ifspc{\ifx\@let@token\@sptoken + \let\ap@next\ap@xifspc\else + \let\ap@next\ap@gettonil\fi\ap@next} +\begingroup +\def\:{\ap@xifspc} +\expandafter\gdef\: {\futurelet\@let@token\ap@ifspc} +\endgroup +% \end{macrocode} +% \cmd{\ap@strpspcs} strips any spaces, usage: \verb~\expandafter\ap@strpspcs\cmd\@nil~ +% where \cs{cmd} is a command that expands to text; the text is returned in \cs{to@nilarg} +% without any leading spaces. +% \begin{macrocode} +\def\ap@strpspcs{\futurelet\@let@token\ap@ifspc} +\def\ap@pgrngLabelsInPream{\@ifundefined{aebLastPage} + {\PackageWarning{aeb_pro}{The \string\atPage\space + command is not supported\MessageBreak in the preamble}}{}} +\def\aeb@removelastcomma#1,\@nil{\aeb@parsetoks={#1}} +\def\aebp@rse#1{\global\let\frstPageSpec\aebp@NO + \aeb@parsetoks={}\aeb@parse#1,\relax} +\def\aeb@parse{\@ifnextchar\relax + {\expandafter\aeb@removelastcomma\the\aeb@parsetoks\@nil} + {\aeb@@parse}} +\def\aeb@@parse#1,{\aeb@@@parse#1-\@nil} +\def\aeb@@@parse#1-#2\@nil{% + \def\argi{#2}\ifx\argi\@empty\def\aeb@next{\aeb@@@@parse{#1}}\else + \def\aeb@next{\aeb@@@@@parse#1-#2}\fi\aeb@next} +\def\aeb@@@@parse#1{%single page #1 + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#1\@nil + \aeb@parsecnt=#1\relax + \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% + \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{Use \cs{frstPageSpec}} +% The \cs{frstPageSpec} signals that page 1 is specified in the +% page specification argument. +% \begin{macrocode} + \ifnum\aeb@parsecnt=1\relax\global\let\frstPageSpec\aebp@YES\fi + \aeb@parse} +\def\aeb@@@@@parse#1-#2-{\def\aeb@lowerlimit{#1}\def\aeb@upperlimit{#2}% + % range argument from #1 to \csname aebLastPage\endcsname + \ifx\aeb@upperlimit\@empty + \@ifundefined{aebLastPage}{\aeb@parsecnt=#1} + {\expandafter\aeb@parsecnt\expandafter= + \csname aebLastPage\endcsname}% + \else % page range #1 to #2, switch the two if #2 < #1 + \aeb@parsecnt=\aeb@lowerlimit\relax + \edef\aeb@lowerlimit{\the\aeb@parsecnt} + \aeb@parsecnt=\aeb@upperlimit\relax + \ifnum\aeb@parsecnt<\aeb@lowerlimit\relax + \aeb@parsecnt=\aeb@lowerlimit\relax + \def\aeb@lowerlimit{#2}% + \def\aeb@upperlimit{#1}% + \fi + \fi + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#1\@nil + \@ifnextchar\atPage{\ap@pgrngLabelsInPream\ap@gobtonil} + {\ap@gobtonil}#2\@nil + \advance\aeb@parsecnt1\relax + \edef\aeb@upperlimit{\the\aeb@parsecnt}% + \aeb@parsecnt=\aeb@lowerlimit\relax +% \end{macrocode} +%\changes{v1.7}{2015/06/17}{Use \cs{frstPageSpec}} +% If page 1 is there, is will be as the lower limit. +% The \cs{frstPageSpec} signals that page 1 is specified in the +% page specification argument. +% \begin{macrocode} + \ifnum\aeb@parsecnt=1\relax\global\let\frstPageSpec\aebp@YES\fi + \loop + \edef\edefaeb@parsetoks{\the\aeb@parsetoks\the\aeb@parsecnt,}% + \aeb@parsetoks=\expandafter{\edefaeb@parsetoks}% + \advance\aeb@parsecnt1\relax + \ifnum\aeb@parsecnt < \aeb@upperlimit\relax\repeat + \aeb@parse} +% \end{macrocode} +% \section{Set Document Actions} +% +% \begin{environment}{willClose} +% \begin{environment}{willSave} +% \begin{environment}{didSave} +% \begin{environment}{willPrint} +% \begin{environment}{didPrint} +% We add a \texttt{willClose} environment, not really meant for the document +% author to use. This environment is used with \cs{setDefaultFS} for saving +% setting and restoring the application preferences for full screen. +% \begin{macrocode} +\@ifpackageloaded{insdljs}{% + \newenvironment{fs@willClose} + {\@defineJS{\fs@will@Close}} + {\end@defineJS} + \let\fs@will@Close\@empty +}{% + \newenvironment{willClose} + {\@defineJS{\will@Close}} + {\end@defineJS} + \let\will@Close\@empty + \newenvironment{fs@willClose} + {\@defineJS{\fs@will@Close}} + {\end@defineJS} + \let\fs@will@Close\@empty + \newenvironment{willSave} + {\@defineJS{\will@Save}} + {\end@defineJS} + \let\will@Save\@empty + \newenvironment{didSave} + {\@defineJS{\did@Save}} + {\end@defineJS} + \let\did@Save\@empty + \newenvironment{willPrint} + {\@defineJS{\will@Print}} + {\end@defineJS} + \let\will@Print\@empty + \newenvironment{didPrint} + {\@defineJS{\did@Print}} + {\end@defineJS} + \let\did@Print\@empty +} +% \end{macrocode} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% \end{environment} +% In addition to the provided environments, there are developer hooks, the package developer +% can use to insert page actions, in addition to what the package user may do. +% Now put the \texttt{willClose} JS into the document \texttt{Catalog}. The developer's +% actions will possibly overwrite that of the user; under the theory that the developer's +% actions are critical to the functioning of the package. The hooks are +% \begin{macrocode} +\let\developer@will@Close\@empty +\let\developer@will@Save\@empty +\let\developer@did@Save\@empty +\let\developer@will@Print\@empty +\let\developer@did@Print\@empty +% \end{macrocode} +%\changes{v0.8g}{2008/06/30} +%{ +% Added developer hooks to this open page events. +%} +%\changes{v2.1}{2016/05/15}{Changes to \string\cs{@setDocAction} for non-Distiller workflows.} +% (2016/05/15) modify to include non-Distiller workflows. +% \begin{macrocode} +\newcommand\@setDocActions{% + \edef\test@will@Close{% + \fs@will@Close\will@Close\developer@will@Close}% + \edef\test@will@Save{\will@Save\developer@will@Save}% + \edef\test@did@Save{\did@Save\developer@did@Save}% + \edef\test@will@Print{\will@Print\developer@will@Print}% + \edef\test@did@Print{\did@Print\developer@did@Print}% + \def\aebp@DocActionsCode{/AA << % + \ifx\test@will@Close\@empty\else/WC << + \JS{\fs@will@Close\will@Close\developer@will@Close} >>\fi + \ifx\test@will@Save\@empty\else/WS << + \JS{\will@Save\developer@will@Save} >>\fi + \ifx\test@did@Save\@empty\else/DS << + \JS{\did@Save\developer@did@Save} >>\fi + \ifx\test@will@Print\@empty\else/WP << + \JS{\will@Print\developer@will@Print} >>\fi + \ifx\test@did@Print\@empty\else/DP << + \JS{\did@Print\developer@did@Print} >>\fi + >> + } + \ifpdfmarkup\literalps@out{\AEB@psMrk{Catalog} + << \aebp@DocActionsCode\space>> /PUT pdfmark}\else + \ifpdf\pdfcatalog{\aebp@DocActionsCode}\else + \ifxetex\immediate + \@pdfm@mark{put @catalog <<\aebp@DocActionsCode\space>>}\fi + \fi\fi +} +\AtBeginDocument{\@setDocActions} +% \end{macrocode} +% +% \section{In support of attachments} +% +% \subsection{Processing the \texttt{attachsource} and \texttt{attachments} key} +% +% If the value of either the \texttt{\texttt{attachsource}} or +% \texttt{attachments} keys are non empty, the values are contained +% in the macros \cs{aeb@attachsource} and \cs{aeb@attachments}. If +% either of these text macros is different from \cs{empty}, we need +% to write out a cut file that lists the requested attachments, then +% input the cut file back in at the end of the package. +% \begin{macro}{\aref} +% This command, whose argument is \textit{delimited by parentheses}, +% is to be used with \cs{inputDataObject}, defined below, to expand +% the value of the \texttt{cName} key, when the label is defined by +% \cs{labelName}. It is also used by this package to set the +% description of the attachment. +% \begin{macrocode} +\def\aref(#1){\csname aeb@aDescript@#1\endcsname} +% \end{macrocode} +% \end{macro} +% The next command \cs{aeb@initAttachWrite} we prepare to write by opening a stream, and +% starting the \texttt{execJS} environment, but only if we have an attachment request. +% \begin{macrocode} +\def\aeb@initAttachWrite{% + \newwrite \aeb@attachmentswrite + \immediate\openout \aeb@attachmentswrite \jobname_attach.cut + \let\verbatim@out\aeb@attachmentswrite + \aeb@IWVO{\string\begin{execJS}{aebpro_attach}}% + {\lccode`P=`\{\lowercase{\aeb@IWVO{try P}}}% +} +% \end{macrocode} +% \changes{v1.4}{2013/02/24}{Support for optional attachments} +% \paragraph{Optional attachments.} Support for optional attachments. +% \begin{macro}{\prjInputUser} +% \begin{macro}{\prjIncludeUser} +% \begin{macro}{\addtoOptAttachments} +% User interface to project for \cs{input} and \cs{include}. These commands +% may be redefined, but they need to include the appropriate input/include +% command in them. The \cs{addtoOptAttachments} command is a way of optionally +% attaching a file without the input. +% \begin{macrocode} +\newcommand{\prjInputUser}[1]{\input{#1}} +\newcommand{\prjIncludeUser}[1]{\include{#1}} +\newcommand{\addtoOptAttachments}[1]{% + \g@addto@macro\AP@addtoAttachments{,#1}} +\newcommand{\getcNameFromFileName}[1]{\@nameuse{descrip4#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% The main code for optional attachments. +% \begin{macrocode} +\def\AP@addtoAttachments{} +% \end{macrocode} +% The attachments are listing in a comma-delimited list. If there is a space following a comma, it may appear +% as part of the path of the next attachment. So, we'll get JavaScript to strip away any leading spaces to +% avoid the need to instruct the user to insert a \texttt{\%} if the attachment list is on multiple lines. +% \begin{macrocode} +\def\jsstrsps{replace(/^\string\s*/, "")} +\def\jsstrdotsp{replace(/\string\.\string\s*/g, ".")} +\ifoptattachments + \def\AP@writeOptAttach{% + \newwrite\AP@OptAttachlist + \immediate\openout \AP@OptAttachlist \jobname_oa.cut +% \end{macrocode} +% Define the optional attachments list command, |\APOptAttachments|. +% \begin{macrocode} + \immediate\write\AP@OptAttachlist{\string\def\string + \APOptAttachments{\AP@addtoAttachments}} + \immediate\closeout\AP@OptAttachlist} +% \end{macrocode} +% Write the optional attachments list (|\APOptAttachments|) at the end of the document. +% \begin{macrocode} + \AtEndDocument{\AP@writeOptAttach} +% \def\AP@addtoAttachments{} + \def\AP@pathInput#1{% + \addtoOptAttachments{#1}\prjInputUser{#1}} + \def\AP@pathInclude#1{% + \addtoOptAttachments{#1.tex}\prjIncludeUser{#1}} +% \end{macrocode} +% Input the optional attachments list (|\APOptAttachments|) here. +% \begin{macrocode} + \InputIfFileExists{\jobname_oa.cut}{% + \def\AP@next{\edef\aeb@attachments + {\aeb@attachments\APOptAttachments}}% + }{\let\AP@next\relax} + \AP@next +\else +% \end{macrocode} +% When \texttt{!optattachments} is taken, we use the user commands \cs{prjInputUser} and +% \cs{prjIncludeUser} versions. +% \begin{macrocode} + \def\AP@pathInput#1{\prjInputUser{#1}} + \def\AP@pathInclude#1{\prjIncludeUser{#1}} +\fi +% \end{macrocode} +% \DescribeMacro{\prjinput}\DescribeMacro{\prjinclude}These are the main +% commands for inputting project files where the files themselves are optionally +% attached. +% \begin{macrocode} +\ifoptattachmentsTaken + \def\prjinput{\hyper@normalise\AP@pathInput} + \def\prjinclude{\hyper@normalise\AP@pathInclude} +% \end{macrocode} +% The \cs{include} command makes the following comparison. +%\begin{verbatim} +% \@for\reserved@a:=\@partlist\do +% {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% +%\end{verbatim} +% The elements from \cs{@parlist} they come from the \cs{includeonly} command. +% The argument of \cs{include} has been normalized using \cs{hyper@normalise} but +% the filenames listed in \cs{includeonly} have not. So the comparison can fail. +% We normalize the file list as well. +% +% When the \texttt{optattachments} is present in the option list, +% the definition of \cs{optattachmentsTaken} is \cs{relax}, hence, +% the redefinition occurs. +% \begin{macrocode} + \let\AP@includeonly\includeonly + \def\includeonly{\hyper@normalise\AP@includeonly} +\else + \def\prjinput{\prjInputUser} + \def\prjinclude{\prjIncludeUser} +\fi +% \end{macrocode} +% \paragraph*{Attaching files.} +% If either the two attachments keys is used, then we execute \cs{aeb@initAttachWrite}. +% \begin{macrocode} +\ifx\aeb@attachsource\@empty + \ifx\aeb@attachments\@empty + \else\aeb@initAttachWrite\fi +\else + \@ifundefined{aeb@attachmentswrite} + {\aeb@initAttachWrite}{} +\fi +% \end{macrocode} +% If \cs{aeb@attachsource} is non empty, go through the comma delimited list, and write to the +% cut file we just opened. +% +%\changes{v0.8i}{2008/10/08}{% +% Beginning with version 7.05, there is a \texttt{description} property. +% Prior to that, the value of \texttt{cname} was used for the description. +% I've added an additional line that sets the description equal to +% \texttt{cname} for 7.05 or later. +%} +%\changes{v1.4d}{2014/02/24}{% +% Within this and the next \cs{@for} look, added a test for the empty +% argument. +%} +% Some commands for setting \texttt{cName} and description. +% \begin{macrocode} +\def\ap@cName(#1){\csname aeb@aName@attach#1\endcsname} +\def\ap@cNamexdef(#1){\expandafter + \xdef\csname aeb@aName@attach#1\endcsname} +\def\ap@cDescript(#1){\csname aeb@aDescript@attach#1\endcsname} +\def\ap@cDescriptSource(#1){\csname aeb@aDescript@#1\endcsname} +\def\ap@cDescriptxdef(#1){\expandafter + \xdef\csname aeb@aDescript@attach#1\endcsname} +\def\ap@cDescriptSourcexdef(#1){\expandafter + \xdef\csname aeb@aDescript@#1\endcsname} +% \end{macrocode} +% We now process the list from the \texttt{attachsource} key. +% \begin{macrocode} +\ifx\aeb@attachsource\@empty\else + \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachsource} + \temp@expand\do{% + \ifx\@@tmp\@empty\else + \expandafter\ap@strpspcs\@@tmp\@nil\edef\@@tmp{\to@nilarg}% + \ap@cDescriptSourcexdef(\@@tmp){\jobname.\@@tmp}% + \aeb@IWVO{\space\space\space\space + var retn=\string\importDataObject({% +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Changed cName from \cs{jobname.\cs{@@tmp}} to +% just \cs{@@tmp}} +% (2015/07/01) Changed cName from \cs{jobname.}\cs{@@tmp} to +% just \cs{@@tmp}. +% \begin{macrocode} + cName: "\@@tmp", + cDIPath: "\jobname.\@@tmp".\jsstrdotsp});}% + \aeb@IWVO{\space\space\space\space + if ( (app.viewerVersion>7) && retn ) +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Changed \texttt{"\cs{jobname.\cs{@@tmp}}"} to +% just \texttt{"\cs{@@tmp}"}} +% (2015/07/01) Changed \texttt{"\cs{jobname.\cs{@@tmp}}"} to +% just \texttt{"\cs{@@tmp}"} within argument of \texttt{this.getDataObject}. +% \begin{macrocode} + this.getDataObject("\@@tmp").description=% + "\string\ap@cDescriptSource(\@@tmp)".\jsstrdotsp;}% + \expandafter + \edef\csname aeb@aName@\@@tmp\endcsname{\jobname.\@@tmp}% + \fi + }% +\fi +% \end{macrocode} +% Similarly, if \cs{aeb@attachments} is non empty, go through the comma delimited list, and write to the +% cut file we just opened. +% \begin{macrocode} +\ifx\aeb@attachments\@empty\else +\typeout{\string\aeb@attachments: \aeb@attachments}% + \aeb@parsecnt=0 + \edef\temp@expand{\noexpand\@for\noexpand\@@tmp:=\aeb@attachments} + \temp@expand\do + {% + \ifx\@@tmp\@empty\else + \expandafter\ap@strpspcs\@@tmp\@nil\edef\@@tmp{\to@nilarg}% + \advance\aeb@parsecnt1\relax +% \end{macrocode} +% Set default definitions of the name and description +% \begin{macrocode} + \ap@cNamexdef(\the\aeb@parsecnt){attach\the\aeb@parsecnt}% + \ap@cDescriptxdef(\the\aeb@parsecnt)% + {AeB Attachment \the\aeb@parsecnt}% + \aeb@IWVO{\space\space\space\space + var retn=\string\importDataObject({% +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Remove \cs{aref} in \texttt{cName}} +% (2015/07/01) Remove \cs{aref} in \texttt{cName} +% \begin{macrocode} + cName:"\string\ap@cName(\the\aeb@parsecnt)",% + cDIPath: "\@@tmp".\jsstrsps});}% + \aeb@IWVO{\space\space\space\space + if ( (app.viewerVersion>7) && retn ) +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Remove \cs{aref} in first argument} +% (2015/07/01) Remove \cs{aref} in first argument +% \begin{macrocode} + this.getDataObject(% + "\string\ap@cName(\the\aeb@parsecnt)").description=% + "\string\ap@cDescript(\the\aeb@parsecnt)";}% + \expandafter +% \end{macrocode} +% We associate the filename (path) with the label \texttt{cName}. This makes it convenient +% to reference an attachment. We can say |\@usenname{descrip4<name>}|. Also defined +% a convenience command \cs{getcNameFromFileName} for that purpose; for example, +% |\getcNameFromFileName{<name>}|. +% \begin{macrocode} + \expandafter\xdef\csname descrip4\@@tmp\endcsname + {\noexpand\ap@cName(\the\aeb@parsecnt)}% + \fi + } +\fi +% \end{macrocode} +% Now, if \cs{aeb@attachmentswrite} is defined, which means we have attachments and we opened a stream, +% we'll close off the environment, and close the file. +% \begin{macrocode} +\@ifundefined{aeb@attachmentswrite}{} +{% + {\lccode`P=`\}\def\jsMsg{"Attachments error: " + + e.toString()}\lowercase{\aeb@IWVO{P catch(e) + { console.println( \jsMsg\space); }}}}% + \aeb@IWVO{\string\end{execJS}} + \immediate\closeout \aeb@attachmentswrite +} +% \end{macrocode} +% Create a little macro to input the file \cs{jobname\_attach.cut} at the end of the package. +% \begin{macrocode} +\def\aeb@inputAttachments{\@ifundefined{aeb@attachmentswrite}{} + {\InputIfFileExists{\jobname_attach.cut}% + {\typeout{Inputting attachments file}}% + {\typeout{Cannot find attachments file}}}% +} +% \end{macrocode} +% \subsection{Creating a PDF Package} +% Beginning with Version 8, there is a special "Package" interface to access attachments. +% The commands in this section support creating a PDF Package using the specified attachments. +% +% The \texttt{viewmode}\IndexKey{viewmode} has values of \texttt{details}, +% \texttt{tile}, \texttt{layout}, and \texttt{hidden}. +% \begin{macrocode} +\define@choicekey+{aebpdfpack}{viewmode}[\val\nr]% + {details,tile,layout,hidden}{% + \ifcase\nr\relax + \def\aeb@pdfpack@viewmode{/D}\or + \def\aeb@pdfpack@viewmode{/T}\or + \def\aeb@pdfpack@viewmode{/T}\or + \def\aeb@pdfpack@viewmode{/H}\fi +}{} +% \end{macrocode} +% The \texttt{initview}\IndexKey{initview} of the package. The value of \texttt{initview} +% is a label name of one of the attached files. +% \begin{macrocode} +\define@key{aebpdfpack}{initview}[]{\def\aeb@pdfpack@initview{#1}} +\let\aeb@pdfpack@initview\@empty +% \end{macrocode} +% \begin{macro}{\earlyAttachForPkgs} +% Use this command to package the attachments to the parent document. +% \begin{macrocode} +\newcommand{\earlyAttachForPkgs}{% +% \end{macrocode} +%\changes{v1.7}{2015/07/11}{Added \string\texttt{CollectionPreview} menu item to assure the Hidden view +% is displayed.} +% (2015/07/11) Recent versions of \textsf{Acrobat DC} seem not to support the Hidden view. There is no +% difference between Hidden and Tiles, so we use \texttt{'CollectionPreview'} +% menu item to force the viewer into Preview mode, which I'm assuming is the same +% as Hidden mode. +% \begin{macrocode} +if (this.collection!=null&&this.collection.initialView == "Hidden") +var hideto=app.setTimeOut("app.clearTimeOut(hideto);" + +"app.execMenuItem('CollectionPreview');",1); +\if@gopro +if(typeof _aebpro_attach == "undefined") +( app.viewerVersion > 8 ) ? % +aebTrustedFunctions(this,aebImportAnFDF,"aebpro_attach.fdf") : % +this.importAnFDF("aebpro_attach.fdf");\fi +% \end{macrocode} +% For Version XI (or prior), there seems to be a bug. When +% no initial view is specified, the cover sheet should be displayed. It is +% but is disappears after a moment in favor of the first listed attachment +% in the package. To compensate for this, we force the Cover Sheet to appear +% after 2 seconds (trial and error value). +% \begin{macrocode} +\ifisPDFPackage\ifx\aeb@pdfpack@initview\@empty^^J% +if(app.viewerVersion<15)^^J% +var pkto=app.setTimeOut("app.clearTimeOut(pkto);" ++"app.execMenuItem('CollectionShowRoot');",5000);\fi\fi} +% \end{macrocode} +% \changes{v1.7k}{2015/08/05}{Added a \cs{ifisPDFPackage} switch} +% (2015/08/05) Added a \cs{ifisPDFPackage} switch. +% \changes{v2.1}{2016/05/15}{Finalized changes in \string\cs{makePDFPackage} to accommodate +% non-Distiller workflows.} +% \begin{macrocode} +\newif\ifisPDFPackage\isPDFPackagefalse +\newcommand{\makePDFPackage}[1]{\isPDFPackagetrue + \setkeys{aebpdfpack}{viewmode=details,#1}% + \ifx\aeb@pdfpack@initview\@empty + \let\aeb@pdfpackage@initview\@empty + \else +% \end{macrocode} +% \changes{v1.7}{2015/07/01}{Removed \cs{aeb@exiii} and \cs{aref()}, +% replaced with \cs{expandafter} and argument.} +% (2015/07/01) Removed \cs{aeb@exiii} and \cs{aref()}, +% replaced with \cs{expandafter} and argument. +% \changes{v2.0}{2016/05/08}{Extend \string\cs{makePDFPackage} to include +% pdftex and xetex.} +% \begin{macrocode} + {\obeyspaces\sanitize@attach\gdef\aeb@pdfpackage@initview% +{/D<\expandafter\stringiiUnicode\aeb@pdfpack@initview\relax>}}% + \fi + \def\aeb@PDFPackageCode{/PageMode/UseAttachments% + /Collection<</Type/Collection% + \aeb@pdfpackage@initview/View\aeb@pdfpack@viewmode>>}% + \ifpdfmarkup + \def\aeb@setPDFPackage{\literalps@out{\AEB@psMrk{Catalog} + <<\aeb@PDFPackageCode>>/PUT pdfmark}}% + \else\ifpdf\def\aeb@setPDFPackage{% + \pdfcatalog{\aeb@PDFPackageCode}}\else + \ifxetex\def\aeb@setPDFPackage{\immediate + \@pdfm@mark{put @catalog <<\aeb@PDFPackageCode>>}}\else + \let\aeb@setPDFPackage\relax\PackageWarning{aeb_pro} + {The \string\makePDFPackage/string\makePDFPortfolio\space + is supported for\MessageBreak + dvips, pdftex, and xetex only}\fi\fi\fi +} +% \end{macrocode} +% \DescribeMacro{\makePDFPortfolio} is an alias for \cs{makePDFPackage}. The accepted +% name for a PDF Package is now a PDF Portfolio. +% \begin{macrocode} +\let\makePDFPortfolio\makePDFPackage +\@onlypreamble\makePDFPackage +% \end{macrocode} +% We check to see if there are any attachments, if there are, we'll +% import them early; useful for \cs{makePDFPackage} and for open events +% that cause the view to display a page other than the first one on opening. +% \begin{macrocode} +\let\aebp@attachments\aebp@Zero +\ifx\aeb@attachsource\@empty\else\let\aebp@attachments\aebp@One\fi +\ifx\aeb@attachments\@empty\else\let\aebp@attachments\aebp@One\fi +\ifx\aebp@attachments\aebp@One + \dev@addToDocOpen{\JS{\earlyAttachForPkgs}}% +\fi +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End of aebpro segment +%</aebpro> +%<*package> +\AtEndOfPackage{\@nameuse{aeb@inputAttachments}} +\AtBeginDocument{\@nameuse{aeb@setPDFPackage}} +\@ifpackageloaded{web}{} + {\def\aebwritelastpage{% + \immediate\write\@auxout{\string\expandafter\string\gdef + \string\csname\space aebLastPage\string\endcsname{\arabic{page}}}} + \AtEndDocument{\clearpage\addtocounter{page}{-1}\aebwritelastpage + \addtocounter{page}{1}}% +} +% End of package segment +%</package> +%<*unicode> +% \end{macrocode} +% \section{Support for linking to attachments.} +% +% \subsection{\texorpdfstring{\cs{ahyperref}, \cs{ahyperlink}, \cs{ahyperextract}} +% {\CMD{ahyperref}, \CMD{ahyperlink}, \CMD{ahyperextract}}} +% +% The \cs{ahyperref} command is for linking between parent and child, or +% between child and child. \cs{ahyperref} takes three arguments, the first optional +% and the second two required. +%\begin{verbatim} +% \ahyperref[<optargs>]{<label>}{<text>} +%\end{verbatim} +% where \texttt{<label>} is one defined by either \cs{autolabelNum} or \cs{labelName}. The +% \texttt{<text>} is the text to be typeset around the link. The optional arguments are defined +% and described below. +% \begin{itemize} +% \item \verb!goto=p2c,c2p,c2c!: The type of jump, parent to child, child to parent, and child to +% child. The default is \texttt{p2c} +% \item \texttt{page=<number>}: the page of the embedded document to jump to. Default is \texttt{0} +% \item \texttt{view=<value>}: the view to be used for the jump. Default is \texttt{Fit} +% \item \texttt{dest=<string>}: jump to a named destination. When this key has a value, the values +% of the keys \texttt{page} and \texttt{view} are ignored. +% \item \verb!open=usepref|new|existing!: open the attachment according to the user preferences, +% a new window, or the existing window. The default is \texttt{userpref} +% \item \verb!border=visible|invisible!: Determines whether a visible rectangle appears around the +% link. The default is \texttt{invisible} +% \item \verb!highlight=none|invert|outline|insert!: How the viewer highlights the link when the +% link is clicked. The default is \texttt{invert}. +% \item \texttt{bordercolor=r g b}: The color of the border when it is visible. The default is black. +% \item \verb!linestyle=solid|dashed|underlined!: The line style of the border when it is visible. +% The default is \texttt{solid} +% \item \texttt{textcolor=<color>}: the color of the text in the hypertext link. An empty +% value is equivalent to \cs{normalcolor}. +% \item \verb!linewidth=thin|medium|thick!: The line width when the border is visible. When invisible, +% this is set to a width of zero. The default is \texttt{thin} +% \item \texttt{preset=\cs{presetCommand}}: A convenience key. You can define some preset values, like so +%\begin{verbatim} +%\def\preseti{bordercolor={0 0 1},highlight=outline,border=visible,% +% linestyle=dashed} +%\end{verbatim} +% Then you can say, for example, +%\begin{verbatim} +%\ahyperref[dest={target1-s:intro},preset=\preseti]{target1}{Jump!} +%\end{verbatim} +% \end{itemize} +% \paragraph*{Key-value pairs of attachment links.} +% The following are the key-values of the optional first argument of \cs{ahyperref} +% \cs{hyperlink} and \cs{hyperextract}.\par\medskip +%\noindent +% The \texttt{page}\IndexKey{page} key, takes a zero-based page number. +% \begin{macrocode} +\define@key{ahref}{page}[0]{\def\ahref@page{#1}} +\def\ahref@page{0} +% \end{macrocode} +% The key \texttt{view}\IndexKey{view} represents an ``explicit destination,'' as termed by the PDF Ref, \S8.2.1. +%\begin{itemize} +% \item \texttt{/XYZ left top zoom} +% \item \texttt{/Fit} +% \item \texttt{/FitH top} +% \item \texttt{/FitV left} +% \item \texttt{/FitR left bottom right} +% \item \texttt{/FitB} +% \item \texttt{/FitBH top} +% \item \texttt{/FitBV left} +%\end{itemize} +% For the \texttt{view} key, enter view=Fit or view=XYB null null null, for example. The forward slash +% is added later. +% +% (2015/07) More recent advances allows \cs{fitpage}, \cs{fitvisible}, +% \cs{actualsize}, \cs{fitheight}, \cs{fitwidth}, and \cs{inheritzoom} to be used. +% These are defined in \textsf{insdljs}. +% +% Each of these is preceded by a page number. The page number is entered via the \texttt{page} +% key. +% +% If a named destination is given with the dest key, then the \texttt{view} and \texttt{page} are ignored. +% \begin{macrocode} +\def\ap@fslash{/} +\def\@isfirstslash#1#2\@nil{\def\arg@i{#1}\ifx\ap@fslash\arg@i + \else\edef\ahref@view@keyvalue{/\ahref@view@keyvalue}\fi} +\define@key{ahref}{view}[/Fit]{\edef\ahref@view@keyvalue{#1}% + \expandafter\@isfirstslash\ahref@view@keyvalue\@nil +} +\def\ahref@view@keyvalue{/Fit} +% \end{macrocode} +% The \texttt{dest}\IndexKey{dest} key +% \begin{macrocode} +\define@key{ahref}{dest}[]{\def\ahref@dest{#1}} +\let\ahref@dest\@empty +% \end{macrocode} +% The \texttt{open}\IndexKey{open} key takes values of \texttt{userpref}, \texttt{new}, and \texttt{existing}. +% \begin{macrocode} +\define@choicekey{ahref}{open}[\val\nr]{userpref,new,existing} +{% + \ifcase\nr\relax + \let\ahref@open@keyvalue\@empty\or + \def\ahref@open@keyvalue{/NewWindow true }\or + \def\ahref@open@keyvalue{/NewWindow false }\fi +}{} +\let\ahref@open@keyvalue\@empty +% \end{macrocode} +% The \texttt{border}\IndexKey{border} key takes values of \texttt{visible} and \texttt{invisible}. +% \begin{macrocode} +\define@choicekey{ahref}{border}[\val\nr]{visible,invisible} +{% + \ifcase\nr\relax + \def\ahref@border{0 0 1}% + \def\ahef@invisible@border{1}\or + \def\ahref@border{0 0 0}% W = 0 also? + \let\ahef@invisible@border\@empty\fi +}{} +% \end{macrocode} +% The \texttt{highlight}\IndexKey{highlight} key takes values of \texttt{none}, +% \texttt{invert}, \texttt{outline}, and \texttt{insert}. +% \begin{macrocode} +\define@choicekey{ahref}{highlight}[\val\nr]{none,invert,outline,insert} +{% + \ifcase\nr\relax + \let\ahref@highlight\@empty\or + \def\ahref@highlight{/H/I}\or + \def\ahref@highlight{/H/O}\or + \def\ahref@highlight{/H/P}\fi +}{} +% \end{macrocode} +% The \texttt{bordercolor}\IndexKey{bordercolor} key\par\medskip\noindent +% (2017/03/08) \cs{ahref@bordercolor} can be a named color, +% \changes{v2.8a}{2017/03/08}{\string\cs{ahref@bordercolor} can be a named color} +% \begin{macrocode} +\define@key{ahref}{bordercolor}[]{\def\ap@argi{#1}\ifx\ap@argi\@empty + \let\ahref@bordercolor\@empty\else + \HyColor@IfXcolor{\HyColor@XZeroOneThreeFour{#1} + {\ahref@bordercolor}{}{}} + {\edef\ahref@bordercolor{#1}}\fi +} % PDF color +\let\ahref@bordercolor\@empty +% \end{macrocode} +% The \texttt{linestyle}\IndexKey{linestyle} key takes values of \texttt{solid}, +% \texttt{dashed}, and \texttt{underlined}. +% \begin{macrocode} +\define@choicekey{ahref}{linestyle}[\val\nr]{solid,dashed,underlined} +{% + \ifcase\nr\relax + \def\ahref@linestyle@keyvalue{/S/S}\or + \def\ahref@linestyle@keyvalue{/S/D}\or % Dashed [0 0 1[3.0]] + \def\ahref@linestyle@keyvalue{/S/U}\fi +} +\def\ahref@dashedlinetyle{/S/D} +% \end{macrocode} +% The \texttt{linewidth}\IndexKey{linewidth} key takes values of \texttt{thin}, +% \texttt{medium}, and \texttt{thick}. +% \begin{macrocode} +\define@choicekey{ahref}{linewidth}[\val\nr]{thin,medium,thick} +{% + \ifcase\nr\relax + \def\ahref@linewidth{1}\or + \def\ahref@linewidth{2}\or + \def\ahref@linewidth{3}\fi +} +% \end{macrocode} +% The \texttt{goto}\IndexKey{goto} key takes values of \texttt{p2c}, +% \texttt{c2p}, and \texttt{c2c}. +% \begin{macrocode} +\define@choicekey{ahref}{goto}[\val\nr]{p2c,c2p,c2c} +{% + \ifcase\nr\relax + \global\let\targetDictionary\targetDictionary@pc\or + \global\let\targetDictionary\targetDictionary@cp\or + \global\let\targetDictionary\targetDictionary@cc\fi +}{} +% \end{macrocode} +% The \texttt{launch}\IndexKey{launch} key takes values of \texttt{save}, +% \texttt{view}, and \texttt{viewnosave}. +% \begin{macrocode} +\define@choicekey{ahref}{launch}[\val\nr]{save,view,viewnosave} + {\edef\ahref@launch@type{\nr}}{} +\def\ahref@launch@type{0}% +% \end{macrocode} +% The \texttt{preset}\IndexKey{preset} key +% \begin{macrocode} +\define@key{ahref}{preset}[]{\def\ahref@preset{#1}} +\let\ahref@preset\@mpty +% \end{macrocode} +% Color of the link text by command \DescribeMacro{\ahrefcolor}\cs{ahrefcolor} +% or as a key \texttt{textcolor}\IndexKey{textcolor}. +% \begin{macrocode} +\def\ahypertxtcolor#1{\def\ahrefcolor{#1}} +\def\ahrefcolor{red} +\define@key{ahref}{textcolor}[]{\def\ahrefcolor{#1}} +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Changed \cs{aeb@exiii} to \cs{expandafter}, changed +% \cs{aref(\#1)} to \texttt{\#1}.} +% (2015/07/01) Changed \cs{aeb@exiii} to \cs{expandafter}, changed +% \cs{aref(\#1)} to \texttt{\#1} in \cs{targetDictionary@pc} +% and \cs{targetDictionary@cc}. +% \begin{macrocode} +\def\targetDictionary@pc#1{% +/T<</N<\expandafter\stringiiUnicode#1\relax>/R/C>>} +\def\targetDictionary@cp#1{/T<</R/P>>} +\def\targetDictionary@cc#1{% +/T<</R/P/T<</N<\expandafter\stringiiUnicode#1\relax>/R/C>>>>} +% \end{macrocode} +% \begin{macro}{\factory@ahyperref@defaults} +% \begin{macro}{\setahyperDefaults} +% \begin{macro}{\resetahyperDefaults} +% The defaults, \cs{factory@ahyperref@defaults}, of \cs{ahyperref}, as indicated above in the descriptions of the keys. Can be redefined, I suppose. +% Perhaps the better approach is to use \cs{setahyperDefaults} to set the defaults, possibly overwriting the factory defaults. +% Use \cs{resetahyperDefaults} to cancel out the user defined defaults. You can also use the \texttt{preset} key for conveniently changing +% the attributes of the link. +% \begin{macrocode} +\def\factory@ahyperref@defaults{goto=p2c,page,dest,open=userpref,view,% + border=invisible,highlight=invert,linestyle=solid,linewidth=thin,% + bordercolor,textcolor=red,preset} +\newcommand{\setahyperDefaults}[1]{\def\aeb@setahyperrefDefaults{#1}} +\let\aeb@setahyperrefDefaults\@empty +\newcommand{\resetahyperDefaults}{% + \let\aeb@setahyperrefDefaults\@empty} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\ahyperref} +% \begin{macro}{\ahyperlink} +% The \cs{ahyperref} command links a parent to its embedded children, or a child to a child. Cool. +% \changes{v1.7}{2015/07/01}{Rewrite the link to stuff, we'll use \texttt{cName} rather than description +% to link to the attachments, this is how it should have been to begin with.} +% (2015/07/01) Rewrite the link to stuff, we'll use \texttt{cName} rather than description +% to link to the attachments, this is how it should have been to begin with. All changes +% dated as (2015/07/01) are the changes needed. +% \begin{macrocode} +\def\aeb@initahref#1{% + \edef\expand@setkeys{% + \noexpand\setkeys{ahref}{\factory@ahyperref@defaults}}% + \expand@setkeys + \ifx\aeb@setahyperrefDefaults\@empty\else +% \end{macrocode} +% For the \cmd{\setahyperrefDefaults} we do not allow \texttt{dest}, \texttt{goto}, +% \texttt{page}, or \texttt{preset}. +% \begin{macrocode} + \edef\expand@setkeys{\noexpand\setkeys{ahref}% + [dest,goto,page,preset]{\aeb@setahyperrefDefaults}}% + \expand@setkeys + \fi + \setkeys{ahref}{#1}% + \ifx\ahref@preset\@empty\else + \edef\expand@setkeys{% + \noexpand\setkeys{ahref}{\ahref@preset}}\expand@setkeys\fi + \let\ahref@dasharray\@empty + \ifx\ahref@linestyle@keyvalue\ahref@dashedlinetyle + \def\aeb@border@parameters{0 0 \ahref@linewidth[3.0]}% + \def\ahref@dasharray{/D[3.0]}% + \else + \edef\aeb@border@parameters{\ahref@border}% + \fi + \ifx\ahef@invisible@border\@empty\def\ahref@linewidth{0}\fi + \def\ahref@BS@Dict{/BS<<% + \ahref@dasharray\ahref@linestyle@keyvalue/W \ahref@linewidth>> + \ifx\ahref@bordercolor\@empty\else + /C[\ahref@bordercolor]\fi\ahref@highlight}% +} +\newcommand{\ahyperref}[3][]{% + \begingroup + \dl@preProcDefns + \def\u{\string\\u}% + \aeb@initahref{#1}% + \ifx\ahref@dest\@empty + \def\ahref@dest@keyvalue{% + /D[\ahref@page\space\ahref@view@keyvalue]}% + \else + \edef\ahref@dest@keyvalue{/D(\labelRef{\ahref@dest})}% + \fi + \aeb@ahref@setlink{#2}{#3}% +} +\newcommand{\ahyperlink}[3][]{% + \begingroup + \dl@preProcDefns + \def\u{\string\\u}% + \aeb@initahref{#1}% + \ifx\ahref@dest\@empty + \def\ahref@dest@keyvalue{% + /D[\ahref@page\space\ahref@view@keyvalue]}% + \else + \def\ahref@dest@keyvalue{/D(\ahref@dest)}% + \fi + \aeb@ahref@setlink{#2}{#3}% +} +\def\aeb@ahref@setlink#1#2{% + \ifx\ahrefcolor\@empty + \@eqlinktxtcolor{}\let\ahypercolor\@empty\else + \def\ahypercolor{\textcolor{\ahrefcolor}}\fi + \setLink[\Border{\aeb@border@parameters}% + \rawPDF{\ahref@BS@Dict}% + \A{\ahref@dest@keyvalue/S/GoToE% + \ahref@open@keyvalue\targetDictionary{#1}}]{\ahypercolor{#2}}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\ahyperextract} +% The \cs{ahyperextract} command extracts an embedded file from the parent +% to simple view the document, to save and view, or simply to save. The +% \texttt{open} key determines the resulting action. +% \begin{macrocode} +\newcommand{\ahyperextract}[3][] +{% + \begingroup\dl@preProcDefns + \def\u{\string\\u}% + \aeb@initahref{#1}% + \ifx\ahrefcolor\@empty + \@eqlinktxtcolor{}\let\ahypercolor\@empty\else + \def\ahypercolor{\textcolor{\ahrefcolor}}\fi + \setLink[\Border{\aeb@border@parameters}% + \rawPDF{\ahref@BS@Dict}% +% \end{macrocode} +%\changes{v1.7}{2015/07/01}{Removed \cs{aref(\#2)}, replaced with \texttt{\#2}} +% (2015/07/01) Removed \cs{aref(\#2)}, replaced with \texttt{\#2} +% \begin{macrocode} +% \A{\JS{this.exportDataObject({cName: "\aref(#2)",% + \A{\JS{this.exportDataObject({cName: "#2",% +nLaunch: \ahref@launch@type})}}]{\ahypercolor{#3}}% + \endgroup +} +% \end{macrocode} +% \end{macro} +% \subsection{Unicodes} +% \begin{macro}{\convertChriiUnicode} +% A simple command for mapping a character to its unicode +% \begin{macrocode} +\def\convertChriiUnicode#1#2{\csarg\gdef{uni@#1}{#2}}% +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\convertChriiUnicode\space{0020} +\convertChriiUnicode{!}{0021} +{\@makeother\" +\convertChriiUnicode{"}{0022}} +%\convertChriiUnicode{"}{0022} % not available, but use \u0022 instead +\convertChriiUnicode{#}{0023} +\convertChriiUnicode{$}{0024} +{\@makeother\% +\convertChriiUnicode{%}{0025}} +\convertChriiUnicode{&}{0026} +\convertChriiUnicode{'}{0027} +\convertChriiUnicode{(}{0028} +\convertChriiUnicode{)}{0029} +\convertChriiUnicode{*}{002A} +\convertChriiUnicode{+}{002B} +\convertChriiUnicode{,}{002C} +\convertChriiUnicode{-}{002D} +\convertChriiUnicode{.}{002E} +\convertChriiUnicode{/}{002F} +\convertChriiUnicode{0}{0030} +\convertChriiUnicode{1}{0031} +\convertChriiUnicode{2}{0032} +\convertChriiUnicode{3}{0033} +\convertChriiUnicode{4}{0034} +\convertChriiUnicode{5}{0035} +\convertChriiUnicode{6}{0036} +\convertChriiUnicode{7}{0037} +\convertChriiUnicode{8}{0038} +\convertChriiUnicode{9}{0039} +\convertChriiUnicode{:}{003A} +\convertChriiUnicode{;}{003B} +\convertChriiUnicode{<}{003C} +\convertChriiUnicode{=}{003D} +\convertChriiUnicode{>}{003E} +\convertChriiUnicode{?}{003F} +\convertChriiUnicode{@}{0040} +\convertChriiUnicode{A}{0041} +\convertChriiUnicode{B}{0042} +\convertChriiUnicode{C}{0043} +\convertChriiUnicode{D}{0044} +\convertChriiUnicode{E}{0045} +\convertChriiUnicode{F}{0046} +\convertChriiUnicode{G}{0047} +\convertChriiUnicode{H}{0048} +\convertChriiUnicode{I}{0049} +\convertChriiUnicode{J}{004A} +\convertChriiUnicode{K}{004B} +\convertChriiUnicode{L}{004C} +\convertChriiUnicode{M}{004D} +\convertChriiUnicode{N}{004E} +\convertChriiUnicode{O}{004F} +\convertChriiUnicode{P}{0050} +\convertChriiUnicode{Q}{0051} +\convertChriiUnicode{R}{0052} +\convertChriiUnicode{S}{0053} +\convertChriiUnicode{T}{0054} +\convertChriiUnicode{U}{0055} +\convertChriiUnicode{V}{0056} +\convertChriiUnicode{W}{0057} +\convertChriiUnicode{X}{0058} +\convertChriiUnicode{Y}{0059} +\convertChriiUnicode{Z}{005A} +\convertChriiUnicode{[}{005B} +%\convertChriiUnicode{\}{005C} % not available, use unicode \u005C +\convertChriiUnicode{]}{005D} +\convertChriiUnicode{^}{005E} +\convertChriiUnicode{_}{005F} +\convertChriiUnicode{`}{0060} +\convertChriiUnicode{a}{0061} +\convertChriiUnicode{b}{0062} +\convertChriiUnicode{c}{0063} +\convertChriiUnicode{d}{0064} +\convertChriiUnicode{e}{0065} +\convertChriiUnicode{f}{0066} +\convertChriiUnicode{g}{0067} +\convertChriiUnicode{h}{0068} +\convertChriiUnicode{i}{0069} +\convertChriiUnicode{j}{006A} +\convertChriiUnicode{k}{006B} +\convertChriiUnicode{l}{006C} +\convertChriiUnicode{m}{006D} +\convertChriiUnicode{n}{006E} +\convertChriiUnicode{o}{006F} +\convertChriiUnicode{p}{0070} +\convertChriiUnicode{q}{0071} +\convertChriiUnicode{r}{0072} +\convertChriiUnicode{s}{0073} +\convertChriiUnicode{t}{0074} +\convertChriiUnicode{u}{0075} +\convertChriiUnicode{v}{0076} +\convertChriiUnicode{w}{0077} +\convertChriiUnicode{x}{0078} +\convertChriiUnicode{y}{0079} +\convertChriiUnicode{z}{007A} +%\convertChriiUnicode{{}{007B} % not available, use unicode \u007B +\convertChriiUnicode{|}{007C} +%\convertChriiUnicode{}}{007D} % not available, use unicode \u007D +{\@makeother~ +\convertChriiUnicode{~}{007E}} +% \end{macrocode} +% \begin{macro}{\EURO} +% \begin{macro}{\BSLASH} +% \begin{macro}{\LBRACE} +% \begin{macro}{\RBRACE} +% \begin{macro}{\DQUOTE} +% These characters are entered into the description parameter of \cs{autolabelNum} +% or \cs{labelName} as either as literal characters or as its unicode \cs{uXXXX}. +% When \cs{u} is detected \cs{@stringiiUnicode}, the command that converts the string +% to all unicode hex, it calls \cs{getRawUnicode} to get the next four characters, which +% should be XXXX, place them in the stream, followed by \cs{@stringiiUnicode} so as to +% continue the processing of the next character in the description string. I've placed +% an \cs{expandafter} in the definition of \cs{getRawUnicode} to allow the commands below +% to be used. Thus instead of using \cs{u20AC}, which might necessitate the user to +% look up the code, \verb!\u\EURO! can be used instead. Additional shortcut commands +% like these can be created. Except for \cs{EURO}, these are the ones \TeX{} has trouble +% processing. +% \begin{macrocode} +\def\EURO{20AC} +\def\BSLASH{005C} +\def\LBRACE{007B} +\def\RBRACE{007D} +\def\DQUOTE{0022} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Display the Unicode encoding of a character +% +% \begin{macrocode} +\def\displayUnicode#1{\csname uni@#1\endcsname} +% \end{macrocode} +% \begin{macro}{\stringiiUnicode} +% This is the primary command for converting a string, which +% may contain \cs{uXXXX} control sequences into unicode encoding. +% The first four hex digits must be \texttt{FEFF} to signal that +% the hex represents unicode. +% \begin{macrocode} +\def\stringiiUnicode{FEFF\expandafter\@stringiiUnicode} +\def\@stringiiUnicode#1{% + \ifx#1\relax\else + \ifx#1\u\aeb@exiii\getRawUnicode + \else + \displayUnicode{#1}\aeb@exiii\@stringiiUnicode + \fi + \fi +} +\def\getRawUnicode{\expandafter\@getRawUnicode} +\def\@getRawUnicode#1#2#3#4{#1#2#3#4\@stringiiUnicode} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\unicodeStr} +% A convenience command for setting the initial value of a form field with unicode. +% Usage: +%\begin{verbatim} +%\labelName{myCoolIV}{\u0022\u20AC|e^\u007B\u005Cln(17)\u007D|$\u0022} +%\textField[\textSize{10}\textFont{MyriadPro-Regular} +% \uDV{\unicodeStr(myCoolIV)}\uV{\unicodeStr(myCoolIV)} +%]{myCoolIV}{1.5in}{12bp} +%\end{verbatim} +% First you set the string using \cs{labelName}. The argument for \cs{unicodeStr} +% is delimited by parentheses, the argument itself is the label defined with +% \cs{labelName}. +% +%\medskip\noindent +% (2015/07/12) If \texttt{\#1} does not define a recognizable label (defined by \cs{labelName} +% we assume \texttt{\#1} is raw hex digits. +% \begin{macrocode} +\def\unicodeStr(#1){\expandafter + \ifx\csname aeb@aDescript@#1\endcsname\relax + FEFF#1\else\aeb@exiii\stringiiUnicode\aref(#1)\relax\fi} +% \end{macrocode} +% \end{macro} +% +% \subsection{\texorpdfstring{\cs{labelName} and \cs{autolabelNum}} +% {\CMD{labelName} and \CMD{autolabelNum}}} +% +% \begin{macro}{\autolabelNum} +% \begin{macro}{\autolabelNum*} +% \begin{macro}{\labelName} +% Commands for defining the description string for the attachments. +% It is important that the description of the attached file, and the reference +% to in in the \texttt{/GoToE} exactly match. The commands define here set up the +% mapping between a ``\LaTeX'' label and the description. These commands also allow +% the document author to overwrite the default attachment descriptions. Usage: +%\begin{enumerate} +%\item\verb!\autolabelNum[<label>]{<attachment_number>}! +%\item\verb!\autolabelNum*[<label>]{<attachment_number>}{<description>}! +%\item\verb!\labelName{<label>}{<description>}! +%\end{enumerate} +% \cs{autolabelNum} and \cs{autolabelNum*} are used with attachments attached using the +% \texttt{attachments} option, while \cs{labelName} is used it the document author attached +% a file using the \texttt{docassembly} environment. \cs{labelName} is also used by +% \cs{autolabelNum} and \cs{autolabelNum*} to make definitions, in that respect, \cs{labelName} +% is the low-level command for setting up the mappings and definitions. +% \begin{macrocode} +\def\ucspace{\u0020} +\begingroup\catcode`\"=\active \gdef\DQ{\string\"}% + \gdef\@handledblquotes{\catcode`\"=\active\def"{\DQ}}% + \toks0=\expandafter{\DLspecialDefs\@handledblquotes}% + \xdef\DLspecialDefs{\the\toks0}% +\endgroup +% \end{macrocode} +%\changes{v1.7l}{2015/08/07}{Add the switch \cs{ifHandleDblQuotes} switch} +% (2015/08/07) Add the switch \cs{ifHandleDblQuotes} switch. +% \begin{macrocode} +\newif\ifHandleDblQuotes \HandleDblQuotesfalse +\def\sanitize@attach{\ifHandleDblQuotes\@handledblquotes\fi% +\@makeother\#\@makeother\$\@makeother\%\@makeother~} +{\obeyspaces\gdef\getdscrptCont#1{\gdef\aebp@description{#1}% +\aeb@labelName}% +\gdef\getdscrptStrCont#1{\gdef\aebp@description{#1}% +\aeb@labelNamestar}}% +% \end{macrocode} +% \changes{v1.7}{2015/07/05}{Modified the commands \string\cs{labelName} and \string\cs{labelName@star} to +% gobble up any spaces between arguments before we switch to \string\cs{obeyspaces}.} +% (2015/07/05) Modified \cs{labelName} and \cs{labelName@star} to +% gobble up any spaces between arguments before we switch to \cs{obeyspaces}. +% \begin{macrocode} +\let\aeb@isFromAutoLabelNum\aebp@Zero +\def\labelName#1{\bgroup\let\aeb@isFromAutoLabelNum\aebp@Zero + \@for\x:=ABCDEFabcdef\do{\@makeother\x}% + \def\aebp@labelname{#1}\@ifnextchar\bgroup{\labelName@i}{}} +% \end{macrocode} +%\changes{v1.7k}{2015/08/02}{Added \cs{labelName@a}} +% (2015/08/02) \cs{autoLabelNum} used to call \cs{labelName}, not it calls +% \cs{labelName@a}, which sets a switch to notify \cmd{\aeb@labelName} of the origins +% of the call. +% \begin{macrocode} +\def\labelName@a#1{\bgroup\let\aeb@isFromAutoLabelNum\aebp@One + \def\aebp@labelname{#1}\@ifnextchar\bgroup{\labelName@i}{}} +\def\labelName@i{\obeyspaces\sanitize@attach\getdscrptCont}% +\def\labelName@star#1{\bgroup\@for\x:=ABCDEFabcdef\do{\@makeother\x}% + \def\aebp@labelname{#1}\@ifnextchar\bgroup{\labelName@star@i}{}}% +\def\labelName@star@i{\obeyspaces\sanitize@attach\getdscrptStrCont}% +\newcommand{\autolabelNum}{% + \@ifstar{\aeb@autoLabelNumstar}{\aeb@autoLabelNum}} +\newcommand\aeb@autoLabelNum[2][]{\def\alnargi{#1}% + \def\@thisattachnum{#2}% + \ifx\alnargi\@empty + \def\aeb@next{% + \labelName@a{attach#2}{AeB\space Attachment\space #2}}% + \else + \def\aeb@next{% + \labelName@a{#1}{AeB\space Attachment\space #2}}% + \fi + \aeb@next% +} +\newcommand{\aeb@autoLabelNumstar}[2][]{% + \def\alnargi{#1}\gdef\@thisattachnum{#2}% + \ifx\alnargi\@empty\def\aeb@next{\labelName@star{attach#2}}\else + \def\aeb@next{\labelName@star{#1}}\fi + \aeb@next% +} +\def\aeb@labelName{% +% \end{macrocode} +% \changes{v1.7k}{2015/08/02}{Added additional logic to \cs{aeb@labelName}} +% (2015/08/02) The definitions differ depending on whether it comes from +% the command \cs{autoLabelNum} or from \cs{labelNum}. +% \begin{macrocode} + \if\aeb@isFromAutoLabelNum\aebp@One + \global\csarg\let + {aeb@aDescript@attach\@thisattachnum}\aebp@description + \global\csarg\let + {aeb@aName@attach\@thisattachnum}\aebp@labelname + \else + \global\csarg\let + {aeb@aDescript@\aebp@labelname}\aebp@description + \global\csarg\let + {aeb@aName@\aebp@labelname}\aebp@labelname\fi\egroup} +\def\aeb@labelNamestar{% + \global\csarg\let + {aeb@aDescript@attach\@thisattachnum}\aebp@description + \global\csarg\let{aeb@aName@attach\@thisattachnum}\aebp@labelname + \global\csarg\let{aeb@aDescript@\aebp@labelname}\aebp@description + \global\csarg\let{aeb@aName@\aebp@labelname}\aebp@labelname\egroup} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% We need a general verbatim write environment, here is the one used by \textsf{exerquiz} and several other packages. +% If \textsf{exerquiz} is loaded, no need to redefine it. +% \begin{macrocode} +\@ifpackageloaded{exerquiz}{} +{% + \def\verbatimwrite{\@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active\catcode`\^^I=12% + \def\verbatim@processline{% + \immediate\write\verbatim@out + {\the\verbatim@line}}% + \verbatim@start} + \def\endverbatimwrite{\@esphack} +} +% \end{macrocode} +% \begin{environment}{attachmentNames} +% Enclose the \cs{labelName} and \cs{autolabelNum} commands this environment, which writes +% it contents verbatim to the file \cs{jobname\_xref.cut} and inputs it back in. Child files can input this +% file to get the labels assigned for them by the parent document. +% \begin{macrocode} +\newenvironment{attachmentNames}{% + \newwrite \aeb@attachments@xref + \immediate\openout \aeb@attachments@xref \jobname_xref.cut + \let\verbatim@out\aeb@attachments@xref +% \end{macrocode} +%\changes{v1.7l}{2015/08/07}{Set \cs{ifHandleDblQuotes} to true} +% (2015/08/07) Set \cs{ifHandleDblQuotes} to true, added a group. +% \begin{macrocode} + \immediate\write\verbatim@out{\string\begingroup + \string\HandleDblQuotestrue}% + \verbatimwrite}{% + \endverbatimwrite + \immediate\write\verbatim@out{\string\endgroup}% + \immediate\closeout \aeb@attachments@xref + \aftergroup\aeb@Input@xref} +\def\aeb@Input@xref{\InputIfFileExists{\jobname_xref.cut}{}{}} +% \end{macrocode} +% \end{environment} +% \begin{macrocode} +% End of unicode segment +%</unicode> +% \end{macrocode} +% \texttt{(2013/04/01)} The \texttt{createicon} block separates out the +% import icon macros, doc and pre-\texttt{docassembly} stuff. +%\changes{v1.4b}{2013/04/01}{The \texttt{createicon} block separates the +%import icon macros, doc and pre-\texttt{docassembly} stuff.} +% \begin{macrocode} +% Begin aebpro and createicon segments +%<*aebpro|createicon> +% \end{macrocode} +% +% \section{Document Assembly Methods} +% Special commands and environment to take advantage of \app{Acrobat}'s extensive +% library of security restricted methods. It is assumed the document author has properly +% installed \texttt{aeb\_pro.js}. +% +% \subsection{The \texttt{docassembly} Environment} +% +% \begin{environment}{docassembly} +% This is a wrapper environment for the \texttt{execJS} environment of the +% \textsf{insDLJS} Package. Place JavaScript lines in this environment and +% the script will execute one time after the file has been distilled and opened +% in Acrobat Pro for the fist time. +% \begin{macrocode} +\newenvironment{docassembly}{% +\execJS{docassembly} +}{\endexecJS} +% \end{macrocode} +% \end{environment} +% \subsection{Supported Assembly JS API} +% +% These are convenience commands -- called JavaScript helper commands -- to +% executing security restricted JavaScript. The JS methods are defined in the +% \texttt{aeb\_pro.js} file, kept as folder JavaScript. These commands are +% executed in a verbatim environment where `\verb!\!' is still the escape +% character. Each of the JavaScript helper commands expects a left +% parenthesis `\texttt{(}' following the command name \emph{on the +% same line} as the command name.\footnote{This requirement is consistent with JavaScript function usage.} +% See the example below for correct usage. +%\begin{verbatim} +%\begin{docassembly} +%\addWatermarkFromFile({ +% bOnTop:false, +% cDIPath:"/C/AcroTeX/AcroPackages/ManualBGs/Manual_BG_Print_AeB.pdf" +%}); +%\end{docassembly} +%\end{verbatim} +% For each of the methods below, see the \textsl{JavaScript for Acrobat API Reference}. +% +%\medskip\noindent The command \cs{theDocObject} is normally set to \texttt{this}, meaning +% the current document. You may need to set it to some other doc object if you are trying to +% access a doc object other than the current one. +% \par\medskip\noindent +% Revised all these function that use \cs{theDocObject}; the revisions allow you to change +% the use of \cs{theDocObject}. The following are support commands for changing \cs{theDocObject} +% from within the \texttt{docassembly} environment. +% \changes{v2.5}{2016/08/03}{Revised all these function that use \string\cs{theDocObject}.} +% \begin{macro}{\chngDocObjectTo} +% All the JavaScript helper commands use \cs{theDocObject}, which is defined to be the \texttt{this} +% object. To change it within the \env{docassembly} environment is difficult. The next command +% aids in that problem. +% \begin{macrocode} +\let\ap@mrk\@empty +\def\ap@gobtocomma#1,{} +\providecommand\chngDocObjectTo[2]{% + \def#1##1\ap@mrk{#2,\ap@gobtocomma##1}} +% \end{macrocode} +% \end{macro} +% The above defines a new command given by \texttt{\#1}. The command has one argument which is all content +% up to the terminating mark \cs{sp@mrk}. The trick to removing \cs{thisDocObject} and replacing it with +% \texttt{\#2}, in the above definition, we insert `\texttt{(\#2}' followed by \cs{ap@gobtocomma}, which absorbs +% \cs{thisDocObject,} (absorbs everything through the first comma), followed by all content (\texttt{\#\#1}); the second \cs{@gobble} absorbs the left +% parenthesis that opens the argument. +% \begin{macrocode} +\def\ap@TF{aebTrustedFunctions} +% \end{macrocode} +% An example of usage of \cs{chngDocObject} is \verb~\chngDocObjectTo{\newDO}{doc}~ +% expanded above the \texttt{docassembly} environment. Later, we can say, +%\begin{verbatim} +% \chngDocObjectTo{\newDO}{doc} +% \begin{docassembly} +% ... +% \docSaveAs\newDO({ cPath: _path }); +% ... +% \end{docassembly} +%\end{verbatim} +%That is, it is placed immediately after any of the commands below that uses \cs{theDocObject}. +% \begin{macro}{\theDocObject} +% This command is used in the definition of all JavaScript helper commands, as seen in the +% definition of \cs{DeclareJSHelper} below. It is set to the doc object \texttt{this}. It can +% be changed using \cs{chngDocObjectTo}, as described above. +% \begin{macrocode} +\def\theDocObject{this} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\DeclareJSHelper} +% A general purpose command for defining what I am calling JavaScript helper commands. +% \begin{macrocode} +\providecommand\DeclareJSHelper[2]{% + \def#1##1({\ap@TF(##1\theDocObject,#2,\ap@mrk}} +% \end{macrocode} +% For example, we declare |\DeclareJSHelper{\docSaveAs}{aebDocSaveAs}| below, the declaration defines a new command, +% \cs{docSaveAs}: +%\begin{verbatim} +% \def\docSaveAs#1({\ap@TF(#1\theDocObject,aebDocSaveAs,\ap@mrk}} +%\end{verbatim} +% Note that the argument of \cs{docSaveAs} is delimited by the left parenthesis, thus \texttt{\#1} is everything through that opening +% parenthesis. This approach allows more flexibility in the definition, there can be spaces following the +% command name |\docSaveAs ({path: _path})|, for example. +% \end{macro} +% \begin{macrocode} +% End aebpro and createicon segments +%</aebpro|createicon> +%<*aebpro> +% \end{macrocode} +% \begin{macro}{\addWatermarkFromFile} +% This is the method \texttt{Doc.addWatermarkFromFile}. +% \begin{macrocode} +\DeclareJSHelper{\addWatermarkFromFile}{aebAddWatermarkFromFile} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End aebpro segment +%</aebpro> +%<*aebpro|createicon> +% \end{macrocode} +% \begin{macro}{\importIcon} +% This is the method \texttt{Doc.importIcon}. +% \begin{macrocode} +\DeclareJSHelper{\importIcon}{aebImportIcon} +% \end{macrocode} +% \begin{macrocode} +% End aebpro and createicon segments +%</aebpro|createicon> +%<*aebpro> +% \end{macrocode} +% \end{macro} +% \begin{macro}{\importSound} +% This is the method \texttt{Doc.importSound}. +% \begin{macrocode} +\DeclareJSHelper{\importSound}{aebImportSound} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\appopenDoc} +% This is the method \texttt{app.openDoc}. +% \begin{macrocode} +\DeclareJSHelper{\appopenDoc}{aebAppOpenDoc} +% \end{macrocode} +% \end{macro} +% This is the method \texttt{Doc.saveAs}. +% \changes{v2.5}{2016/08/31}{Added \string\cs{docSaveAs}} +% \begin{macro}{\docSaveAs} +% This is the document method \texttt{Doc.saveAs}. +% \begin{macrocode} +\DeclareJSHelper{\docSaveAs}{aebDocSaveAs} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\insertPages} +% This is the method \texttt{Doc.insertPages}. +% \begin{macrocode} +\DeclareJSHelper{\insertPages}{aebInsertPages} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\createTemplate} +% This is the method \texttt{Doc.createTemplate}. +% \begin{macrocode} +\DeclareJSHelper{\createTemplate}{aebCreateTemplate} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\importDataObject} +% This is the method \texttt{Doc.importDataObject}. +% \begin{macrocode} +\DeclareJSHelper{\importDataObject}{aebImportDataObject} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\executeSave} +% To save the document, use at the \emph{end of the doc assembly environment}. Usage: +% \verb!\executeSave()!. The \cs{@gobble} used below absorbs the comma that is placed immediately +% after the second argument by \cs{DeclareJSHelper}. +% \begin{macrocode} +\DeclareJSHelper{\executeSave}{aebSaveAs,"Save"\@gobble} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\extractPages} +% API to extract pages from a newly formed document. +% \begin{macrocode} +\DeclareJSHelper{\extractPages}{aebExtractPages} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\mailDoc} +% Used by eEnvelope to programmatically mail a document. +% \begin{macrocode} +\DeclareJSHelper{\mailDoc}{aebMailDoc} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\sigInfo} +% \begin{macro}{\signatureSign} +% \begin{macro}{\signatureSetSeedValue} +% The \cs{signInfo} command is used for entering signing formation into what will +% become an object. \cs{signatureSign} takes no arguments, but uses the info +% entered by \cs{signInfo}. An example is +%\begin{verbatim} +%\begin{docassembly} +%\signInfo{ +% cSigFieldName: "sigOfDPS", ohandler: security.PPKLiteHandler, +% cert: "D_P_Story.pfx", password: "dps017", +% oInfo: { location: "Niceville, FL", +% reason: "I am approving this document", +% contactInfo: "dpstory@acrotex.net", +% appearance: "My Signature" } +%}; +%\signatureSign +%\end{docassembly} +%\end{verbatim} +% The \cs{sigInfo} command is a latex interface to creating the +% \texttt{oSigInfo} object. +% \begin{macrocode} +\newcommand{\sigInfo}{var oSigInfo=} +\def\sigFieldObj(#1){var oSigField=this.getField(#1)} +% \end{macrocode} +% For the \cs{signatureSetSeedValue}, the field object is required. +% This function assumes that the JavaScript variable \texttt{oSigField} +% is the field object. For examle, +%\begin{verbatim} +%\begin{docassembly} +%\sigFieldObj("sigOfDPS"); +%\signatureSetSeedValue({ +% lockDocument:true, +% appearanceFilter:"My Signature", +% reasons: ["This is a reason", "This is a better reason"], +% flags:0x80|0x100|0x8 +%}); +%\end{docassembly} +%\end{verbatim} +% The signatureSetSeedValue() methods seeds a signature field with various default values +% available to the signer. +%\begin{verbatim} +%\begin{docassembly} +%var sv={ +% mdp: "defaultAndComments", +% reasons: ["This is a reason", "This is a better reason"], +% flags:0x80|0x100|0x8 +%}; +%\sigFieldObj("sigOfDPS"); +%\signatureSetSeedValue(sv); +%\end{docassembly} +%\end{verbatim} +% \begin{macrocode} +\def\signatureSetSeedValue#1{% + \ap@TF( oSigField, aebSignatureSetSeedValue, } +% \end{macrocode} +% The function \cs{signatureSign} takes the info in the \texttt{oSigInfo} object, +% gets the security handler object, logs into the handler, calls +% \texttt{signatureSetSeedValue} if the \texttt{sv} property is in the +% \texttt{oSigInfo} object, and signs the field. +% \begin{macrocode} +\begin{defineJS}[\def\defineJSjsR{^^J}]{\signatureSign} +if ( typeof oSigInfo.oHandler=="undefined" ) + oSigInfo.oHandler=security.PPKLiteHandler; +var engine=aebTrustedFunctions( security, + aebSecurityGetHandler, oSigInfo.oHandler ); +var path2Cert = (typeof oSigInfo.path2Cert == "undefined") ? + aebTrustedFunctions( this, aebAppGetPath, + {cCategory:"user"} )+"/Security"+"/"+oSigInfo.cert : + oSigInfo.path2Cert; +aebTrustedFunctions( engine, aebSecurityHandlerLogin, + { cPassword: oSigInfo.password, cDIPath: path2Cert}); +var oSigField = this.getField(oSigInfo.cSigFieldName); +oSigInfo.oInfo.password=oSigInfo.password; +if ( typeof oSigInfo.sv!="undefined" ) { + for (var o in oSigInfo.sv ) + oSigInfo.oInfo[o]=oSigInfo.sv[o]; +} +var oSigArgs={ oSig: engine, oInfo: oSigInfo.oInfo }; +if ( typeof oSigInfo.cLegalAttest!="undefined" ) + oSigArgs.cLegalAttest=oSigInfo.cLegalAttest; +if ( typeof oSigInfo.cDIPath!="undefined") + oSigArgs.cDIPath=oSigInfo.cDIPath; +if ( typeof oSigInfo.bUI!="undefined") + oSigArgs.bUI=oSigInfo.bUI; +aebTrustedFunctions( oSigField, aebSignatureSign, oSigArgs ); +\end{defineJS} +% \end{macrocode} +% \begin{macro}{\certifyInvisibleSign} +% This command uses the trusted version of \texttt{certifyInvisibleSign} to sign. The command +% requires that \cs{sigInfo} is populated appropriately. +%\begin{verbatim} +%\begin{docassembly} +%\sigInfo{ +% cert: "DonStory.pfx", password: "myPassword", +% cLegalAttest: "Certified using JavaScript", +% bUI:false, +% oInfo: { +% location: "Niceville, FL", +% reason: "I am certifying this document", +% mdp: "defaultAndComments", +% } +%}; +%\certifyInvisibleSign +%\end{docassembly} +%\end{verbatim} +% \begin{macrocode} +\begin{defineJS}[\def\defineJSjsR{^^J}]{\certifyInvisibleSign} +if ( typeof oSigInfo.oHandler=="undefined" ) + oSigInfo.oHandler=security.PPKLiteHandler; +var engine=aebTrustedFunctions( security, + aebSecurityGetHandler, oSigInfo.oHandler ); +var path2Cert=aebTrustedFunctions( this, aebAppGetPath, + {cCategory:"user"} )+"/Security"+"/"+oSigInfo.cert; +aebTrustedFunctions( engine, aebSecurityHandlerLogin, + { cPassword: oSigInfo.password, cDIPath: path2Cert}); +oSigInfo.oInfo.password=oSigInfo.password; +var oSigArgs={ oSig: engine, oInfo: oSigInfo.oInfo }; +if ( typeof oSigInfo.cLegalAttest!="undefined" ) + oSigArgs.cLegalAttest=oSigInfo.cLegalAttest; +if ( typeof oSigInfo.cDIPath!="undefined") + oSigArgs.cDIPath=oSigInfo.cDIPath; +if ( typeof oSigInfo.bUI!="undefined") + oSigArgs.bUI=oSigInfo.bUI; +aebTrustedFunctions( this, aebCertifyInvisibleSign, oSigArgs ); +\end{defineJS} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macrocode} +% End aebpro segment +%</aebpro> +%<*aebpro|createicon> +% \end{macrocode} +% \subsection{Pre-docassembly Commands} +% +% In this section, we'll gather some ``useful'' commands +% for combining several \texttt{docassembly} tasks together. +% The \texttt{docassembly} environment is a partial-verbatim +% environment, expansion is severely limited. (\verb!\! is +% the escape sequence, but \verb!{}! are no longer grouping characters; hence +% macros with no argument can be expanded.) The trick is to expand +% before placing the lines in the \texttt{docassembly} environment. +% +% \subsubsection{Import and Place Images} +% +% \begin{macro}{\declareImageAndPlacement} +% With this command, the document author can import images (icons) +% into the document give them names, and associate the image with a +% push button, specifically, once created by the \cs{placeImage} +% command, defined below. The command may be used several times, once +% for each image (icon) that is to be embedded and placed. +% +% This command should appear outside the \texttt{docassembly} environment. +% +% In the example below, give an image a name manAvatar, specify the +% path (\texttt{man1.pdf}) and list the names of the push buttons +% (ones created by \cs{placeImage}) where this image is to appear as +% a button face. +%\begin{verbatim} +% \declareImageAndPlacement +% { +% name=manAvatar,path=man1.pdf,placement={Avatar1,Avatar2} +% } +%\end{verbatim} +%\par\medskip\noindent +%The macro \cs{@importIconToks} will contain all JavaScript the commands created +% by the command \cs{declareImageAndPlacement}. \cs{aebp@image@cnt} is used +% for automatically generating a name if one is not given. +% \begin{macrocode} +\let\predocassemJS\@empty +\def\aeb@image@cnt{0} +% \end{macrocode} +% These keys are^^A +% valid for the argument of \cs{declareImageAndPlacement}: +% name, path, and placement are required; if the image is a PDF, \texttt{page=0} is the +% default, otherwise, you can specify from which page the PDF image is to be +% extracted from the PDF file. +% \IndexKey{name}\IndexKey{path}\IndexKey{page}\IndexKey{placement}\IndexKey{embedonly}% +% \IndexKey{firstpage}\IndexKey{lastpage}^^A +% \begin{macrocode} +\define@key{importIcons}{name}[]{\def\importIcons@name{#1}} +\define@key{importIcons}{path}[]{\def\importIcons@path{#1}} +\define@key{importIcons}{page}[]{\def\importIcons@page{#1}} +\define@key{importIcons}{placement}[]{\def\importIcons@placement{#1}} +\define@boolkey{importIcons}{embedonly}[true]{} +\define@key{importIcons}{firstpage}[]{\def\importIcons@firstpage{#1}} +\define@key{importIcons}{lastpage}[]{\def\importIcons@lastpage{#1}} +% \end{macrocode} +% The next two macros parse \cs{importIcons@placement} after it has been +% broken down into its comma-delimited parts. We pick off the optional +% argument using \cs{aebp@getFace}, then we call \cs{aebp@getPlacement} to +% get the field name. These are executed from within \cs{declareImageAndPlacement} +% below. +% +% If there is no optional argument, the default is 0, for the normal appearance state. +% \begin{macrocode} +\newcommand{\aebp@getFace}[1][0]{% + \def\importIcons@face{#1}\aebp@getPlacement} +\def\aebp@getPlacement#1\@nil{\def\importIcons@fieldname{#1}% + \expandafter\ap@strpspcs\importIcons@fieldname\@nil + \edef\importIcons@fieldname{\to@nilarg}% +} +% \end{macrocode} +% The command \cs{declareImageAndPlacement} takes one argument, key-value +% pairs as described above. This command may be use many times, once for +% each image. +% \begin{macro}{\declareMultiImages} +% Here is another macro, created after \cs{declareImageAndPlacement}, +% that enables the declaration of multiple images and placements. +% The following is an example of usage: +%\begin{verbatim} +%\declareMultiImages{% +% {name=manAvatar,path=man1.pdf,placement={Avatar1,Avatar2}} +% {path=girl.png,placement={Avatar3,Avatar4}} +% {path=AcroFord.jpg,placement=AcroFord} +% {path=scot.gif,placement=Scot} +%} +%\end{verbatim} +% (9/24/2009) Now you can enter the face number as an optional argument +% in the placement value: \texttt{[0]} (default, normal icon), \texttt{[1]} (down icon) +% \texttt{[2]} (rollover icon). The optional argument precedes the field name. For Example +%\begin{verbatim} +%\declareMultiImages +%{% +% {path=graphics/man1.pdf,placement={Avatar1,Avatar2}} +% {path=graphics/girl.png,placement={[2]Avatar1,[2]Avatar2}} +%} +%\end{verbatim} +% \begin{macrocode} +\newcommand{\declareMultiImages}[1]{% + \edef\@tforExp{\noexpand\@tfor\noexpand\@dipArgs:=#1}% + \@tforExp\do{% + \expandafter\declareImageAndPlacement + \expandafter{\@dipArgs}% + }% +} +% \end{macrocode} +% \end{macro} +% The definition of \cs{declareImageAndPlacement}. Keys recognized are +% defined above: \texttt{name}, \texttt{path}, \texttt{page}, \texttt{placement}. +% \begin{macrocode} +\newcommand{\declareImageAndPlacement}[1]{% + \edef\@tempexp{\noexpand\setkeys{importIcons}{name,path,page,% + placement,embedonly=false,#1}}\@tempexp + \ifx\importIcons@name\@empty{\count0=\aeb@image@cnt + \advance\count0by1\relax\xdef\aeb@image@cnt{\the\count0}}% + \edef\importIcons@name{aebImage\aeb@image@cnt}\fi + \ifx\importIcons@path\@empty + \PackageError{aeb_pro}{The `path' key is required} + {Please give the path of the icon.}\fi + \ifx\importIcons@placement\@empty\ifKV@importIcons@embedonly\else + \PackageWarningNoLine{aeb_pro}{% + The `placement' key was not found for the\MessageBreak + image named "\importIcons@name".\MessageBreak + Specify this key, or insert the image manually in\MessageBreak + the docassembly environment.}\fi\fi + \xdef\predocassemJS{\predocassemJS + var retn=\importIcon({cName:"\importIcons@name",% + cDIPath:"\importIcons@path"% + \ifx\importIcons@page\@empty\else,% + nPage:\importIcons@page\fi});^^J% + if ( retn==-1 ) console.println("The file + \string\"\importIcons@path\string\" could not be opened.");^^J% + if ( retn==-2 ) console.println("Selected page + (page=\importIcons@page) for \string\"\importIcons@path\string\" + is invalid.");^^J}% + \ifx\importIcons@placement\@empty\else + \@for\@fieldname:=\importIcons@placement\do{% + \expandafter\aebp@getFace\@fieldname\@nil + \xdef\predocassemJS{\predocassemJS + var f = this.getField("\importIcons@fieldname");^^J% + if ( f == null ) console.println("The field + \string\"\importIcons@fieldname\string\" + does not exist.");^^J% + try { f.buttonSetIcon(this.getIcon("\importIcons@name"),% + \importIcons@face); } + catch(e){};^^J}% + }% + \fi +} +\@onlypreamble\declareImageAndPlacement +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Embed Multi-page Images} +% +% \begin{macro}{\iconNameI} +% \cs{iconNameI} is the ``template name'' for the icons, this template is a JavaScript string and expands to a +% function of \texttt{i}. The default definition is given below. +% \begin{macrocode} +\newcommand{\iconNameI}[1]{\def\IconNameI(##1){#1}} +\iconNameI{#1+"."+i} +%\iconNameI{#1+i} +\@onlypreamble\iconNameI +% \end{macrocode} +% \begin{macro}{\embedMultiPageImages} +% \cs{embedMultiPageImages} is designed for a PDF filled with icon pages. It sets up a JavaScript +% loop, and imports the specified page range. The name of the icon is determined by +% the command \cs{iconNameI}, this is function of the JavaScript variable \texttt{i}, the index +% for the loop. The command embeds the icons only. The parameters are\dots +% \begin{itemize} +% \item[] key-value pairs: \texttt{firstpage}, \texttt{lastpage}, \texttt{placement}, +% \texttt{name} and \texttt{path} are the only keys recognized. +%\end{itemize} +% \begin{macrocode} +\newcommand{\embedMultiPageImages}[1]{% + \setkeys{importIcons}{name,path,page,placement,% + firstpage,lastpage,#1}% + \ifx\importIcons@firstpage\@empty + \def\importIcons@firstpage{1}\else + {\count0=\importIcons@firstpage}\fi + \ifx\importIcons@lastpage\@empty + \def\importIcons@lastpage{this.numPages}\else + {\count0=\importIcons@lastpage}\fi + \ifx\importIcons@name\@empty + \PackageError{aeb_pro}{The `name' key is required} + {Please give the icon family a name.}\fi + \ifx\importIcons@path\@empty + \PackageError{aeb_pro}{The `path' key is required} + {Please give the path of the icon.}\fi + \def\r{^^J}\def\t{\space\space\space\space}% + \let\predocassemJSPlace\@empty + \ifx\importIcons@placement\@empty\else + \@for\@fieldname:=\importIcons@placement\do{% + \expandafter\aebp@getFace\@fieldname\@nil + \edef\predocassemJSPlace{\predocassemJSPlace\t + var f = this.getField("\importIcons@fieldname."+i);\r\t + if ( f == null ) console.println("The field + \string\"\importIcons@fieldname."+i+"\string\" + does not exist.");\r\t + try { f.buttonSetIcon(this.getIcon(% +\IconNameI("\importIcons@name")),% + \importIcons@face); } + catch(e){};\r}% + }% + \fi + \xdef\predocassemJS{\predocassemJS + var l=\importIcons@lastpage-\importIcons@firstpage+1;\r + for (var i=0; i<l; i++) {\r\t + var retn=\importIcon({% + cName:\IconNameI("\importIcons@name"),% + cDIPath:"\importIcons@path",% + nPage:\importIcons@firstpage+i-1});\r\t + if ( retn==-1 ) console.println("The file + \string\"\importIcons@path\string\" could not + be opened.");\r\t + if ( retn==-2 ) console.println("Selected page + (page="+(i+1)+") for \string\"\importIcons@path\string\" + is invalid.");\r + \predocassemJSPlace + }\r + var oIcon=this.getIcon("nullIcon");\r + if ( oIcon == null ) + this.addIcon("nullIcon", this.createIcon("", 0, 0));\r + }% +} +\@onlypreamble\embedMultiPageImages +% End aebpro and createicon segments +%</aebpro|createicon> +%<*aebpro> +% \end{macrocode} +% \begin{macrocode} +% End aebpro segment +%</aebpro> +%<*animecommon> +% \end{macrocode} +% \begin{macro}{\placeAnimeCtrlBtnFaces} +% This command is part of the button anime set. It embeds (using the command \cs{declareMultiImages}) +% the icon appearances of the anime controls, The field names for these controls have a name +% of the form +%\begin{quote} +%\texttt{<anime\_basename>4BtnCtrl.<fieldName>} +%\end{quote} +% where \texttt{<anime\_basename>} is the +% base name of the field that displays the images; and \texttt{<fieldName>} is the name of +% the particular control. +% +% The first parameter is the relative or absolute path to the icons set (this path is +% used by Acrobat JavaScript, not by {\LaTeX}; the second parameter is a comma-delimited +% list of button animes to be controlled. An example follows: +%\begin{verbatim} +%\placeAnimeCtrlBtnFaces{graphics/btn_anime_icons1.pdf}% +% {myAnimation,mysine,FamPhotos} +%\end{verbatim} +% \begin{macrocode} +\newcommand{\placeAnimeCtrlBtnFaces}[3][\pathToBtnCtrlIcons]{\begingroup + \toks@={\aep@I{\aep@setAFirst}{animeFirst}% + \aep@I{\aep@setASB}{animeSB}% + \aep@I{\aep@setAPB}{animePB}% + \aep@I{\aep@setAPaus}{animePause}% + \aep@I{\aep@setAPF}{animePF}% + \aep@I{\aep@setASF}{animeSF}% + \aep@I{\aep@setALast}{animeLast}% + \aep@I{\aep@setAPlus}{animePlus}% + \aep@I{\aep@setAMinus}{animeMinus}}% + \def\aep@I##1##2{\let##1\@empty}\the\toks@ + \def\aep@I##1##2{\edef##1{##1,\aep@thisAnime4BtnCtrl.##2}}% + \@for\aep@thisAnime:=#3\do{\the\toks@}% + \def\aep@I##1##2{\edef##1{\expandafter\@gobble##1}}\the\toks@ + \ifx\pathToBtnCtrlIcons\@empty + \let\@pathsep\@empty\else\def\@pathsep{/}\fi + \declareMultiImages{% +% \end{macrocode} +% A document author may supply his own icon set, they must be placed in a +% PDF document in the expected order:\par +% \begin{center} +% \begin{tabular}{cl} +% Page & Icon\\\hline +% 0 & Go to first frame\\ +% 1 & Go to last frame\\ +% 2 & Step back one frame\\ +% 3 & Step forward one frame\\ +% 4 & Play backward\\ +% 5 & Play forward\\ +% 6 & Pause\\ +% 7 & Increase speed\\ +% 8 & Decrease speed +% \end{tabular} +% \end{center} +% \begin{macrocode} + {path=#1\@pathsep#2,page=0,placement={\aep@setAFirst}} + {path=#1\@pathsep#2,page=2,placement={\aep@setASB}} + {path=#1\@pathsep#2,page=4,placement={\aep@setAPB}} + {path=#1\@pathsep#2,page=6,placement={\aep@setAPaus}} + {path=#1\@pathsep#2,page=5,placement={\aep@setAPF}} + {path=#1\@pathsep#2,page=3,placement={\aep@setASF}} + {path=#1\@pathsep#2,page=1,placement={\aep@setALast}} + {path=#1\@pathsep#2,page=7,placement={\aep@setAPlus}} + {path=#1\@pathsep#2,page=8,placement={\aep@setAMinus}} + }% + \endgroup +} +\@onlypreamble\placeAnimeCtrlBtnFaces +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End animecommon segment +%</animecommon> +%<*aebpro> +% \end{macrocode} +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{\placeImageToBtn} +% \cs{iconNameI} is the ``template name'' for the icons, this template is a +% JavaScript string and expands to a function of \texttt{i}. The default +% definition is given below. +% \begin{macrocode} +\newcommand{\placeImageToBtn}[1]{% + \setkeys{importIcons}{name,path,page,placement,#1}% + \ifx\importIcons@placement\@empty\else + \@for\@fieldname:=\importIcons@placement\do{% + \expandafter\aebp@getFace\@fieldname\@nil + \xdef\predocassemJS{\predocassemJS + var f = this.getField("\importIcons@fieldname");^^J% + if ( f == null ) console.println("The field + \string\"\importIcons@fieldname\string\" + does not exist.");^^J% + try { f.buttonSetIcon(this.getIcon("\importIcons@name"),% + \importIcons@face); } + catch(e){};^^J}% + }% + \fi +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsubsection{\texorpdfstring{\cs{insertPreDocAssembly}}{\CMD{insertPreDocAssembly}}} +% \begin{macro}{\insertPreDocAssembly} +% This command is to be used within the \texttt{docassembly} environment, +% and expands to all the JavaScript lines created by +% \cs{declareImageAndPlacement}. +% \begin{macrocode} +% End aebpro segment +%</aebpro> +%<*aebpro|createicon> +\newcommand{\insertPreDocAssembly}{\predocassemJS} +\let\importAndSetImages\insertPreDocAssembly +% \end{macrocode} +% \end{macro} +% +% \subsection{Placing an Image (\texorpdfstring{\cs{placeImage}}{\CMD{placeImage}})} +% +% \begin{macro}{\placeImage} +% This command creates the target push buttons for the images imported using +% \cs{declareImageAndPlacement} and \cs{importAndSetImages}. It creates a readonly +% push button with an icon only appearance. The first argument can be used +% to modify the appearance (as described in the eforms manual), the second is +% the name of the field (this is referenced in the \texttt{placement} key of +% \cs{declareImageAndPlacement}, the third and fourth parameters are the width +% and height, respectively of the push button. +% \begin{macrocode} +\newcommand{\placeImage}[4][]{\pushButton[% + \BC{}\BG{}\S{S}\Ff{\FfReadOnly}\autoCenter{n}\FB{true} + #1\I{null}\TP{1}]{#2}{#3}{#4}} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End of aebpro and createicon segments +%</aebpro|createicon> +%<*animecommon> +% \end{macrocode} +% +% \subsection{Button and Ocg Animation (Anime)} +% +% The following are the key-value pairs common to both button and ocg anime. +% \begin{macro}{\animeSetup} +% \begin{macro}{\widthFirstRow} +% \cs{animeSetup} can be used to set the anime parameters when controls=none, and +% you want to move button set to a place other than the default location, which is +% below the anime. After setting the parameters, we have some code for calculating +% the \cs{widthFirstRow}. this value is used by \cs{insertCtrlButtons} to set the +% width of an enclosing \cs{parbox}, the first row is always wider than the second. +% \begin{macrocode} +\newcommand{\animeSetup}[1]{% + \let\animeSetupPresets\@empty + \edef\@tempExp{\noexpand\setkeys{btnAnime}{#1}}\@tempExp +% \setkeys{btnAnime}{#1}% + \ifx\btnAnimeCtrlBdryColor\@empty\else +% \end{macrocode} +% Calculate the presets for the buttons as passed by the key-values of +% \cs{animeSetup}. +% \begin{macrocode} + \edef\@tmpExp{\noexpand\g@addto@macro% + \noexpand\animeSetupPresets{% + \noexpand\BC{\btnAnimeCtrlBdryColor}}}\@tmpExp + \edef\@tmpExp{\noexpand\g@addto@macro% + \noexpand\animeSetupPresets{% + \noexpand\W{\btnAnimeCtrlBdryWidth}}}\@tmpExp\fi +% \end{macrocode} +% Calculate the value of \cs{@btnanimerowsep}, the distance between rows +% \begin{macrocode} + \edef\@btnanimerowsep{\btnanimerowsep}% dps10 +% \setlength{\@tempdima}{\btnanimerowsep+2bp}% +% \edef\@btnanimerowsep{\the\@tempdima}% +% \end{macrocode} +% Calculate the width of the widest row, usually the first. +% \begin{macrocode} + \setlength{\@tempdima}{% + (\btnAnimeCtrlW+2bp)*\numWidgetsFirstRow+% + (\btnanimebtnsep*(\numWidgetsFirstRow-1))}% + \addtolength{\@tempdima}{\addSpaceBtwnPMBtns}% + \edef\widthFirstRow{\the\@tempdima}% +} +% \end{macrocode} +% \begin{macro}{\insertCtrlButtons} +% This command can be used to place the anime controls somewhere other than at +% the default location (under the anime). +% \begin{macrocode} +\newcommand{\insertCtrlButtons}[1][c]{% + \parbox[#1][\totalheight+2bp]{\widthFirstRow}{% + \offinterlineskip\centering\aep@btn@anime@controls}} +\newcommand{\setspaceBtwnPMBtns}[1]{{% + \settowidth{\@tempdima}{#1\kern2bp}% + \xdef\tmp@spaceBtwnPMBtns{\the\@tempdima}}% + \edef\@spaceBtwnPMBtns{\tmp@spaceBtwnPMBtns}} +\setspaceBtwnPMBtns{\space} +\def\addSpaceBtwnPMBtns{\ifKV@btnAnime@usetworows0bp\else + \ifKV@btnAnime@nospeedcontrol0bp\else\@spaceBtwnPMBtns\fi\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \paragraph{Define Key-value Pairs for anime.} The next set of code +% defines the key-value pairs for \cs{btnAnime} and \texttt{ocgAnime}.\IndexKey{type} +% \IndexKey{fieldName}\IndexKey{ocgAnimeName}\IndexKey{iconName}\IndexKey{speed}\par +% \IndexKey{nFrames} +% \begin{macrocode} +\define@choicekey+{btnAnime}{type}[\val\nr]% + {loop,palindrome,stopatboundary}[stopatboundary]{% + \edef\aebp@btnAnime@type{\nr}}{} +\define@key{btnAnime}{fieldName}[]{\gdef\animeBtnFieldName{#1}} +\define@key{btnAnime}{ocgAnimeName}[]{\gdef\animeBtnFieldName{#1}} +\define@key{btnAnime}{iconName}[]{\gdef\animeBtnBaseName{#1}} +\define@key{btnAnime}{speed}[200]{\gdef\animeBtnSpeed{#1}} +\define@key{btnAnime}{nFrames}[]{\gdef\nFrames{#1}} +% \end{macrocode} +% Additional keys +% \IndexKey{autorun}\IndexKey{autopause}\IndexKey{autoplayevent} +% \IndexKey{autopauseevent} +% \IndexKey{poster}% +% \begin{macrocode} +\define@boolkey{btnAnime}{autorun}[true]{} +\define@boolkey{btnAnime}{autopause}[true]{} +\define@choicekey+{btnAnime}{autoplayevent}[\val\nr]% + {pageopen,pagevisible}[pageopen]{\ifcase\nr\relax + \def\aebp@autoplayevent{\AAPageOpen}\or + \def\aebp@autoplayevent{\AAPageVisible}\fi}{}% +\def\aebp@autoplayevent{\AAPageOpen} +\define@choicekey+{btnAnime}{autopauseevent}[\val\nr]% + {pageclose,pageinvisible}[pageclose]{\ifcase\nr\relax + \def\aebp@autopauseevent{\AAPageClose}\or + \def\aebp@autopauseevent{\AAPageInvisible}\fi}{}% +\def\aebp@autopauseevent{\AAPageClose} +\define@choicekey+{btnAnime}{poster}[\val\nr]% + {first,last,none}[first]{\edef\aebp@btnAnime@poster{\nr}}{} +% \end{macrocode} +% (Needs FIX) Behavior of the poster. When \texttt{poster=first} this is OK, no bugs. +% When \texttt{poster=last} and the animation begins (at least for button) +% the animation does not appear to be running until the last frame, then +% it starts up. In this case, we display the last frame but when play is pressed +% the animation is `cleared' and begins from frame 1. +% \begin{macrocode} +% \end{macrocode} +% The following are key-values for the control buttons, in addition +% to \texttt{ctrlwidth}\IndexKey{ctrlwidth} and \texttt{ctrlheight}\IndexKey{ctrlheight}, +% we also include \texttt{ctrlbdrywidth}\IndexKey{ctrlbdrywidth} +% and \texttt{ctrlbdrycolor}\IndexKey{ctrlbdrycolor} the latter two so we can get the spacing +% correct. +% \begin{macrocode} +\define@key{btnAnime}{ctrlwidth}[18bp]{\def\btnAnimeCtrlW{#1}} +\define@key{btnAnime}{ctrlheight}[9bp]{\def\btnAnimeCtrlH{#1}} +\define@choicekey{btnAnime}{ctrlbdrywidth}[\val\nr]{none,% + thin,medium,thick}[thin]{\edef\btnAnimeCtrlBdryWidth{\nr}} +% \end{macrocode} +% (2017/03/08) Let \texttt{ctrlbdrycolor} accept \pkg{xcolor}, if loaded +% \changes{v2.8a}{2017/03/08}{\string\texttt{ctrlbdrycolor} accepts \string\pkg{xcolor}, if loaded} +% \begin{macrocode} +\define@key{btnAnime}{ctrlbdrycolor}[]{\def\ap@argi{#1}% + \ifx\ap@argi\@empty\let\btnAnimeCtrlBdryColor\@empty\else + \HyColor@IfXcolor{\HyColor@XZeroOneThreeFour{#1} + {\btnAnimeCtrlBdryColor}{}{}} + {\edef\btnAnimeCtrlBdryColor{#1}}\fi +} % PDF color +\let\animeSetupPresets\@empty +% \end{macrocode} +% A command to set the space between control buttons, uses \cs{btnanimebtnsep} +% \begin{macrocode} +\newcommand{\@ctrlsbtnsep}{\cgBdry[\btnanimebtnsep]} % dps10 +% \end{macrocode} +% \begin{macro}{\btnanimebtnsep} +% The space between buttons +% \begin{macro}{\vspacectrlsep} +% The vertical space between the bottom of the anime and the control button set. +% \begin{macro}{\btnanimerowsep} +% The vertical distance between two rows of control buttons. +% \begin{macrocode} +\newcommand{\btnanimebtnsep}{1bp} +\newcommand{\vspacectrlsep}{3bp} +\newcommand{\aep@vspacectrlsep}{\vspacectrlsep} +\newcommand{\btnanimerowsep}{1bp} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \paragraph{Definitions of ``skins'' may be redefined.} +% \begin{macro}{\btnAnimeSkini} +% \begin{macro}{\btnAnimeSkinii} +% \begin{macro}{\btnAnimeSkiniii} +% \begin{macro}{\btnAnimeSkiniv} +% \begin{macro}{\btnAnimeSkinv} +% \begin{macro}{\btnAnimeSkinvi} +% The definitions of the various control button layouts. These are normally +% not used by the document author. +% \begin{macrocode} +\newcommand{\btnAnimeSkini}{\ifKV@btnAnime@usetworows + \makebox[\linewidth][c]{% + \btnAnimeGoToFirst\@ctrlsbtnsep\btnAnimeStepBack + \@ctrlsbtnsep\btnAnimePlayBack + \@ctrlsbtnsep\btnAnimePause + \@ctrlsbtnsep\btnAnimePlayForward + \@ctrlsbtnsep\btnAnimeStepForward + \@ctrlsbtnsep\btnAnimeGoToLast}\ifKV@btnAnime@nospeedcontrol\else + \vcgBdry[\@btnanimerowsep]\makebox[\linewidth][c]{% + \btnAnimePlus\@ctrlsbtnsep\btnAnimeMinus}\fi\else + \makebox[\linewidth][s]{\hss + \btnAnimeGoToFirst + \@ctrlsbtnsep\btnAnimeStepBack + \@ctrlsbtnsep\btnAnimePlayBack + \@ctrlsbtnsep\btnAnimePause + \@ctrlsbtnsep\btnAnimePlayForward + \@ctrlsbtnsep\btnAnimeStepForward + \@ctrlsbtnsep\btnAnimeGoToLast + \ifKV@btnAnime@nospeedcontrol\else + \kern\@spaceBtwnPMBtns\btnAnimePlus + \@ctrlsbtnsep\btnAnimeMinus\fi\hss}\fi} +\newcommand{\btnAnimeSkinii}{\ifKV@btnAnime@usetworows + \makebox[\linewidth][c]{% + \btnAnimeGoToFirst + \@ctrlsbtnsep\btnAnimePlayBack + \@ctrlsbtnsep\btnAnimePause + \@ctrlsbtnsep\btnAnimePlayForward + \@ctrlsbtnsep\btnAnimeGoToLast}% + \ifKV@btnAnime@nospeedcontrol\else\vcgBdry[\@btnanimerowsep]% + \makebox[\linewidth][c]{\btnAnimePlus\@ctrlsbtnsep + \btnAnimeMinus}\fi\else\makebox[\linewidth][s]{\hss + \btnAnimeGoToFirst\@ctrlsbtnsep + \btnAnimePlayBack\@ctrlsbtnsep\btnAnimePause% + \@ctrlsbtnsep\btnAnimePlayForward\@ctrlsbtnsep + \btnAnimeGoToLast\ifKV@btnAnime@nospeedcontrol\else + \kern\@spaceBtwnPMBtns\btnAnimePlus + \@ctrlsbtnsep\btnAnimeMinus\fi\hss}\fi} +\newcommand{\btnAnimeSkiniii}{\ifKV@btnAnime@usetworows + \makebox[\linewidth][c]{% + \btnAnimeGoToFirst\@ctrlsbtnsep\btnAnimePause + \@ctrlsbtnsep\btnAnimePlayForward}% + \ifKV@btnAnime@nospeedcontrol\else + \vcgBdry[\@btnanimerowsep]\makebox[\linewidth][c]{% + \btnAnimePlus\@ctrlsbtnsep\btnAnimeMinus}\fi\else + \makebox[\linewidth][s]{\hss + \btnAnimeGoToFirst\@ctrlsbtnsep\btnAnimePause + \@ctrlsbtnsep\btnAnimePlayForward + \ifKV@btnAnime@nospeedcontrol\else\kern\@spaceBtwnPMBtns + \btnAnimePlus\@ctrlsbtnsep\btnAnimeMinus\fi\hss}\fi} +\newcommand{\btnAnimeSkiniv}{% + \makebox[\linewidth][c]{% + \btnAnimeGoToFirst + \@ctrlsbtnsep\btnAnimeStepBack + \@ctrlsbtnsep\btnAnimeStepForward + \@ctrlsbtnsep\btnAnimeGoToLast}} +\newcommand{\btnAnimeSkinv}{\PackageWarning{aeb_pro} + {skin5 is undefined.\MessageBreak You may customize + by defining skin5;\MessageBreak meanwhile, using default, + skin1}\btnAnimeSkini} +\newcommand{\btnAnimeSkinvi}{\PackageWarning{aeb_pro} + {skin6 is undefined.\MessageBreak You may customize + by defining skin6;\MessageBreak meanwhile, using default, + skin1}\btnAnimeSkini} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% The choice for the \texttt{controls}\IndexKey{controls} key. \texttt{skin5} and \texttt{skin6} +% default to \texttt{skin1}. These can be redefined for a custom configuration. +% \begin{macrocode} +\newcommand{\aepnumWidgetsFirstRow}[2]{\def\numWidgetsFirstRow{% + \ifKV@btnAnime@nospeedcontrol#1\else + \ifKV@btnAnime@usetworows#1\else#2\fi\fi}} +\newcommand{\numWidgetsFirstRowV}{\aepnumWidgetsFirstRow{7}{9}} +\newcommand{\numWidgetsFirstRowVI}{\aepnumWidgetsFirstRow{7}{9}} +\define@choicekey+{btnAnime}{controls}[\val\nr]% + {none,skin1,skin2,skin3,skin4,skin5,skin6}[skin1]{% + \ifcase\nr\relax + \let\aep@btn@anime@controls\@empty + \def\widthFirstRow{0pt}\or + \def\aep@btn@anime@controls{\btnAnimeSkini}% + \aepnumWidgetsFirstRow{7}{9}\or + \def\aep@btn@anime@controls{\btnAnimeSkinii}% + \aepnumWidgetsFirstRow{5}{7}\or + \def\aep@btn@anime@controls{\btnAnimeSkiniii}% + \aepnumWidgetsFirstRow{3}{5}\or + \def\aep@btn@anime@controls{\btnAnimeSkiniv}% + \aepnumWidgetsFirstRow{4}{4}\or + \def\aep@btn@anime@controls{\btnAnimeSkinv}% + \numWidgetsFirstRowV\or + \def\aep@btn@anime@controls{\btnAnimeSkinvi}% + \numWidgetsFirstRowVI\fi + }{} +% \end{macrocode} +% The \texttt{usetworows}\IndexKey{usetworows} and +% \texttt{nospeedcontrol}\IndexKey{nospeedcontrol} key +% \begin{macrocode} +\define@boolkey{btnAnime}{usetworows}[true]{} +\define@boolkey{btnAnime}{nospeedcontrol}[true]{} +% \end{macrocode} +% Set the defaults for button animation. +% \begin{macrocode} +\setkeys{btnAnime}{fieldName,iconName,speed,nFrames,type,poster, + controls,usetworows=false,nospeedcontrol=false,ctrlwidth,ctrlheight, + ctrlbdrywidth,ctrlbdrycolor} +% \end{macrocode} +% \begin{macrocode} +\newcommand{\btnAnimePresets}[1]{\def\aeb@btnAnimePresets{#1}} +\def\aeb@btnAnimePresets{} +% \end{macrocode} +% \begin{macro}{\ctrlButtonsWrapper} +% The \cs{ctrlButtonsWrapper} command takes one argument, and that is +% \cs{in\-sert\-Ctrl\-But\-tons}. Redefine this command to, for example, place +% a \cs{colorbox} around the button set, +%\begin{verbatim} +% \renewcommand\ctrlButtonsWrapper}[1]{\colorbox{red}{#1}} +%\end{verbatim} +% The default definition is\dots +% \begin{macrocode} +\newcommand{\ctrlButtonsWrapper}[1]{#1} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End animecommon segment +%</animecommon> +%<*btnanime> +% \end{macrocode} +% \subsubsection{Define \texorpdfstring{\cs{btnAnime}}{\CMD{btnAnime}}} +% \begin{macro}{\btnAnime} +% The command \cs{btnAnime} supplies basic animation support using buttons. +% The command \cs{btnAnime} assumes the images are embedded in the document using +% \cs{embedMultiPageImages}, icon images for the controls are supplied by +% \cs{placeAnimeCtrlBtnFaces}. +% \begin{macrocode} +\newcommand{\btnAnime}[3]{\begingroup\animeSetup{#1}% + \ifx\animeBtnFieldName\@empty\PackageError{aeb_pro}% + {The fieldName key is required}{}\fi + \ifx\animeBtnBaseName\@empty\PackageError{aeb_pro}% + {The iconName key is required}{}\fi + \ifx\nFrames\@empty\PackageError{aeb_pro}% + {The nFrames key is required}{}\fi + \parbox[t][#3]{#2}{% +% \end{macrocode} +% Set the properties of the pushbutton to be created. +% \begin{macrocode} + \everyPushButton{\BC{}\BG{}\S{S}\autoCenter{n}\FB{true}\TP{1}% + \Ff{\FfReadOnly}\presets{\aeb@btnAnimePresets}\I{null}}% +% \end{macrocode} +% Set the options for the first frame, it is either visible if \texttt{poster=first} +% or hidden, otherwise. +% \begin{macrocode} + \edef\termLoop{\nFrames}\edef\firstBtnOpts{% + \ifnum\aebp@btnAnime@poster=0 \else\noexpand\F{\FHidden}\fi + \noexpand\AA{\ifKV@btnAnime@autorun + \aebp@autoplayevent{\noexpand\btnAnimePFAction}\fi + \ifKV@btnAnime@autopause + \aebp@autopauseevent{\noexpand\btnAnimePauseAction}\fi}}% +% \end{macrocode} +% Begin with the first button. +% \begin{macrocode} + \makebox[0pt][l]{\expandafter\pushButton + \expandafter[\firstBtnOpts]{\animeBtnFieldName.0}{#2}{#3}}% +% \end{macrocode} +% If \texttt{poster=last}, decrement \cs{termLoop} by one. +% \begin{macrocode} + \ifnum\aebp@btnAnime@poster=1 + \count0=\nFrames\relax\advance\count0by-1 + \edef\termLoop{\the\count0}\fi\@tempcnta=1 +% \end{macrocode} +% Begin to `stack' the buttons (first button already in place) +% \begin{macrocode} + \loop\ifnum\@tempcnta<\termLoop\relax + \makebox[0pt][l]{\pushButton[\F{\FHidden}]{% + \animeBtnFieldName.\the\@tempcnta}{#2}{#3}}% + \advance\@tempcnta1\relax\repeat +% \end{macrocode} +% Finished with the look, if \texttt{poster=last}, then we did not stack +% the last button, we do it now. +% \begin{macrocode} + \ifnum\aebp@btnAnime@poster=1\relax\makebox[0pt][l]{% + \pushButton{\animeBtnFieldName.\termLoop}{#2}{#3}}% + \fi\hfill\ifx\aep@btn@anime@controls\@empty\else + \offinterlineskip\vcgBdry[\vspacectrlsep]% +% \end{macrocode} +% Now build the control buttons +% \begin{macrocode} + \everyPushButton{}\centering + \ctrlButtonsWrapper{\insertCtrlButtons}\fi + }%parbox + \endgroup +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +% End btnanime segment +%</btnanime> +%<*ocganime> +% \end{macrocode} +% \subsubsection{Define \texttt{ocgAnime}} +% \begin{environment}{ocgAnime} +% We upgrade the ocg animation to the same level of button animation. We define the +% \texttt{ocgAnime} environment. Between he \verb!\begin{ocgAnime}! and \verb!\end{ocgAnime}!, +% place the code for creating the animation. The only required parameters consist of the same +% key-value pairs accepted by \cs{btnAnime}. Some keys are not used, such as \texttt{iconName}. +% The fields \texttt{ocgAnimeName} and \texttt{nFrames} are required. +% \begin{macrocode} +\newenvironment{ocgAnime}[1]{\animeSetup{#1}% + \ifx\animeBtnFieldName\@empty\PackageError{aeb_pro}% + {The ocgAnimeName key is required}{}\fi + \ifx\nFrames\@empty\PackageError{aeb_pro}% + {The nFrames key is required}{}\fi + \DeclareAnime{\animeBtnFieldName}{\animeBtnSpeed}{\nFrames}% +}{% + \edef\aep@ExpOpts{\noexpand\AA{\ifKV@btnAnime@autorun + \aebp@autoplayevent{\noexpand\btnAnimePFAction}\fi + \ifKV@btnAnime@autopause\aebp@autopauseevent{% + \noexpand\btnAnimePauseAction}\fi}}\smash{\makebox[0pt][l]% + {\expandafter\pushButton\expandafter[\aep@ExpOpts\W0\BC{}\BG{}\S{S}]% + {\animeBtnFieldName-autorunpause}{0bp}{0bp}}}% + \ifx\aep@btn@anime@controls\@empty\else\offinterlineskip + \vcgBdry[\vspacectrlsep]\everyPushButton{}% + \centering\ctrlButtonsWrapper{\insertCtrlButtons}\fi +} +% \end{macrocode} +% \end{environment} +% \begin{macrocode} +% End of ocganime segment +%</ocganime> +%<*animecommon> +% \end{macrocode} +% \begin{macro}{\btnAnimeCtrlPresets} +% Use \cs{btnAnimeCtrlPresets} to set the appearances for all these buttons below. +% \begin{macro}{\btnAnimeGoToFirst} +% \begin{macro}{\btnAnimeStepBack} +% \begin{macro}{\btnAnimePlayBack} +% \begin{macro}{\btnAnimePause} +% \begin{macro}{\btnAnimePlayForward} +% \begin{macro}{\btnAnimeStepForward} +% \begin{macro}{\btnAnimeGoToLast} +% \begin{macro}{\btnAnimePlus} +% \begin{macro}{\btnAnimeMinus} +% The control buttons for button anime. These commands are not normally used by +% the document author, but can be used for a custom layout. +% \begin{macrocode} +\newcommand{\btnAnimeCtrlPresets}[1]{\def\aeb@btnAnimeCtrlPresets{#1}} +\def\aeb@btnAnimeCtrlPresets{} +\newcommand{\btnAnimeGoToFirst}{% + \pushButton[\TU{Go to first frame}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimeFirstAction}}]% + {\animeBtnFieldName4BtnCtrl.animeFirst}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}}% +\newcommand{\btnAnimeStepBack}{% + \pushButton[\TU{Step Back}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimeSBAction}}]% + {\animeBtnFieldName4BtnCtrl.animeSB}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimePlayBack}{% + \pushButton[\TU{Play Backwards}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimePBAction}}]% + {\animeBtnFieldName4BtnCtrl.animePB}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimePause}{% + \pushButton[\TU{Pause}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimePauseAction}}]% + {\animeBtnFieldName4BtnCtrl.animePause}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimePlayForward}{% + \pushButton[\TU{Play Forwards}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimePFAction}}]% + {\animeBtnFieldName4BtnCtrl.animePF}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimeStepForward}{% + \pushButton[\TU{Step Forward}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimeSFAction}}]% + {\animeBtnFieldName4BtnCtrl.animeSF}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimeGoToLast}{% + \pushButton[\TU{Go to last frame}\S{S}\BC{} + \FB{false}\I{null}\TP{1}\presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimeLastAction}}]% + {\animeBtnFieldName4BtnCtrl.animeLast}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +% These last two do not take an icon. +\newcommand{\btnAnimePlus}{% + \pushButton[\TU{Increase speed\r Shift-click to restore + default speed}%\textFont{HeBo}\CA{+} + \S{S}\BC{}\FB{false}\I{null}\TP{1} + \presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimePlusAction}}]% + {\animeBtnFieldName4BtnCtrl.animePlus}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +\newcommand{\btnAnimeMinus}{% + \pushButton[\TU{Decrease speed\r Shift-click to restore + default speed}%\textFont{HeBo}\uCA{FEFF2212} + \S{S}\BC{}\FB{false}\I{null}\TP{1} + \presets{\aeb@btnAnimeCtrlPresets} + \presets{\animeSetupPresets}\A{\JS{\btnAnimeMinusAction}}]% + {\animeBtnFieldName4BtnCtrl.animeMinus}% + {\btnAnimeCtrlW}{\btnAnimeCtrlH}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% The following are the field events for the controls for \cs{btnAnime} +% and \texttt{acgAnime}. +% \begin{macrocode} +\newcommand{\btnAnimeFirstAction}{% +if (typeof \animeBtnFieldName\space == "object")\r\t + btnAnimeFirst(\animeBtnFieldName); +} +\newcommand{\btnAnimeSBAction}{% + if ( typeof \animeBtnFieldName\space=="undefined")\r\t + var \animeBtnFieldName= new Object();\r + btnAnimePlay(\animeBtnFieldName,"\animeBtnFieldName",% + "\animeBtnBaseName",\animeBtnSpeed,\nFrames,false,% + \aebp@btnAnime@type,true); +} +\newcommand{\btnAnimePBAction}{% + if ( typeof \animeBtnFieldName\space=="undefined")\r\t + var \animeBtnFieldName= new Object();\r + btnAnimePlay(\animeBtnFieldName,"\animeBtnFieldName",% + "\animeBtnBaseName",\animeBtnSpeed,\nFrames,false,% + \aebp@btnAnime@type,false); +} +\newcommand{\btnAnimePauseAction}{% + if ((typeof \animeBtnFieldName\space == "object")&&% + \animeBtnFieldName.animeStart)\r\t + btnAnimePause(\animeBtnFieldName); +} +\newcommand{\btnAnimePFAction}{% + if ( typeof \animeBtnFieldName\space=="undefined")\r\t + var \animeBtnFieldName= new Object();\r + btnAnimePlay(\animeBtnFieldName,"\animeBtnFieldName",% + "\animeBtnBaseName",\animeBtnSpeed,\nFrames,true,% + \aebp@btnAnime@type,false); +} +\newcommand{\btnAnimeSFAction}{% + if ( typeof \animeBtnFieldName\space=="undefined")\r\t + var \animeBtnFieldName= new Object();\r + btnAnimePlay(\animeBtnFieldName,"\animeBtnFieldName",% + "\animeBtnBaseName",\animeBtnSpeed,\nFrames,true,% + \aebp@btnAnime@type,true); +} +\newcommand{\btnAnimeLastAction}{% + if (typeof \animeBtnFieldName\space == "object")\r\t + btnAnimeLast(\animeBtnFieldName); +} +\newcommand{\btnAnimePlusAction}{% + if (typeof \animeBtnFieldName\space == "object")\r\t + btnAnimePlus(\animeBtnFieldName,\animeBtnSpeed); +} +\newcommand{\btnAnimeMinusAction}{% + if (typeof \animeBtnFieldName\space == "object")\r\t + btnAnimeMinus(\animeBtnFieldName,\animeBtnSpeed); +} +% \end{macrocode} +% The supporting JavaScript. This set of JavaScript functions support both button anime and +% ocg anime (the \cs{btnAnime} command and the \texttt{ocgAnime} environment). +% \begin{macrocode} +\begin{insDLJS}[_loadBtnAnimeCtrls]{btnanime} + {AeB Pro: Button and Ocg Anime Controls} +var _loadBtnAnimeCtrls=true; +var activeAnimes=new Array(); +% \end{macrocode} +% This function may be called with a single argument \texttt{oAnime} +% when the anime is playing. +% \begin{macrocode} +function btnAnimePlay(oAnime,fieldName,baseFrameName,% +nSpeed,nFrames,bForward,type,bStep) { + // ocgAnime is characterized by baseFrameName="" + if ( oAnime.animeStart && !oAnime.animePause ) return; + var callingFieldName=event.target.name; + var re=/\.anime(PB|PF)/; + var doRebuild=( event.shift && re.test(callingFieldName) ); + if ( (arguments.length>1) && % +( (typeof activeAnimes[fieldName] == "undefined")|| doRebuild) ) { + activeAnimes[fieldName]=oAnime; + oAnime.isOcgAnime=(baseFrameName==""); // ocg change + oAnime.fieldName=fieldName; + oAnime.baseFrameName=baseFrameName; + oAnime.numSecs=nSpeed; + oAnime.nFrames=nFrames; + oAnime.type=type; + oAnime.bStep=bStep; + oAnime.aMyIcons = new Array(); + oAnime.count = 0; + if ( !oAnime.isOcgAnime ) {// ocg change + for ( var i=0; i < nFrames; i++) { + oAnime.aMyIcons[i] = this.getField(fieldName+"."+i); +% \end{macrocode} +% (2015/08/09) When starting for the first time, be sure initial frame +% showing is the first frame 0. +% \begin{macrocode} + oAnime.aMyIcons[i].display=(i==0)?display.visible:% +display.hidden; + } + } + } + if (arguments.length>1) { + oAnime.bForward=bForward; + oAnime.bStep=bStep; + } +% \end{macrocode} +% \texttt{type}: \texttt{loop}(0), \texttt{palindrome}(1), \texttt{stopatboundary}(2) +% \begin{macrocode} + if (oAnime.bStep) { + this.delay=true + if ( oAnime.isOcgAnime ) // ocg change + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=false; // ocg + else + oAnime.aMyIcons[oAnime.count].display=display.hidden; + var currCount=oAnime.count; + if (oAnime.bForward) { + oAnime.count++; + if (oAnime.count==oAnime.nFrames) // hit upper boundary + oAnime.count=(oAnime.type==0)?0:currCount; + } else { + oAnime.count--; + if (oAnime.count<0) + oAnime.count=(oAnime.type==0)?(oAnime.nFrames-1):0; + } + if ( oAnime.isOcgAnime ) // ocg change + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=true; // ocg + else + oAnime.aMyIcons[oAnime.count].display=display.visible; + this.delay=false; + } else { + var args="\""+oAnime.fieldName+"\","+oAnime.type; + oAnime.run = app.setInterval(% +"btnAnimeNewFrame("+args+")",oAnime.numSecs); + oAnime.animeStart=true; + oAnime.animePause=false; + } +} +function btnAnimeFirst(oAnime) +{ + try { app.clearInterval(oAnime.run);} catch(e){} + oAnime.animeStart=false; + oAnime.animePause=false; + if ( oAnime.isOcgAnime ) + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=false; // ocg + else + oAnime.aMyIcons[oAnime.count].display=display.hidden; + oAnime.count=0; + if ( oAnime.isOcgAnime ) + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=true; // ocg + else + oAnime.aMyIcons[0].display=display.visible; +} +function btnAnimeLast(oAnime) +{ + try { app.clearInterval(oAnime.run);} catch(e){} + oAnime.animeStart=false; + oAnime.animePause=false; + var l = oAnime.nFrames-1; + if ( oAnime.isOcgAnime ) + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=false; // ocg + else + oAnime.aMyIcons[oAnime.count].display=display.hidden; + oAnime.count=l; + if ( oAnime.isOcgAnime ) + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(l+1)).state=true; // ocg + else + oAnime.aMyIcons[l].display=display.visible; +} +function btnAnimePause(oAnime) +{ + try { app.clearInterval(oAnime.run);} catch(e){} + oAnime.animePause=true; +} +function btnAnimePlus(oAnime,nDefSpeed){ + var isPlaying=(oAnime.animeStart&&!oAnime.animePause); + if (isPlaying) btnAnimePause(oAnime); + if ( event.shift ) oAnime.numSecs=nDefSpeed; + else oAnime.numSecs -= 50; + if (oAnime.numSecs<10) oAnime.numSecs=10 + if (isPlaying) btnAnimePlay(oAnime); +} +function btnAnimeMinus(oAnime,nDefSpeed){ + var isPlaying=(oAnime.animeStart&&!oAnime.animePause); + if (isPlaying) btnAnimePause(oAnime); + if ( event.shift ) oAnime.numSecs=nDefSpeed; + else oAnime.numSecs += 50; + if (isPlaying) btnAnimePlay(oAnime); +} +function btnAnimeNewFrame(fieldName, type) +{ +% \end{macrocode} +% \texttt{type=0,2,3}: \texttt{loop}(0), \texttt{palindrome}(1), \texttt{stopatboundary}(2) +% \begin{macrocode} + var oAnime=activeAnimes[fieldName]; + this.delay=true + if ( oAnime.isOcgAnime ) // ocg change + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=false; + else + oAnime.aMyIcons[oAnime.count].display=display.hidden; + var currCount=oAnime.count; + var bBdaryMet=false; + if (oAnime.bForward) { + oAnime.count++; + if (oAnime.count==oAnime.nFrames) { + if(type==0) oAnime.count \%= oAnime.nFrames; + else if(type==1) { + oAnime.count=currCount; + oAnime.count--; + oAnime.bForward=false; + } else { + bBdaryMet=true; + oAnime.count=currCount; + } + } + } else { + oAnime.count--; + if (oAnime.count<0) { + if(type==0) oAnime.count=(oAnime.nFrames-1); + else if(type==1) { + oAnime.count=currCount; + oAnime.count++; + oAnime.bForward=true; + } else { // stop + bBdaryMet=true; + oAnime.count=currCount; + } + } + } + if ( oAnime.isOcgAnime) // ocg change + getxBld("anime!!"+oAnime.fieldName+"\#"% ++(oAnime.count+1)).state=true; + else + oAnime.aMyIcons[oAnime.count].display=display.visible; + this.delay=false; + if ( type==2 && bBdaryMet ) { + try { app.clearInterval(oAnime.run);} catch(e){} + // try { app.clearTimeOut(timeout);} catch(e){} + oAnime.animeStart=false; + oAnime.animePause=false; + } +} +\end{insDLJS} +% \end{macrocode} +% \begin{macrocode} +% End of animecommon segment +%</animecommon> +% \end{macrocode} +% \begin{macrocode} +% Begin package segment +%<*package> +\ap@restoreCats +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/aeb-pro/aeb_pro.ins b/texmf-dist/source/latex/aeb-pro/aeb_pro.ins new file mode 100644 index 00000000..51ec6ecc --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/aeb_pro.ins @@ -0,0 +1,67 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2010 D. P. Story +%% +%% This file is part of the AcroTeX eDucation Bundle (AeB). +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2013/04/01} +\def\batchfile{aeb_pro.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate{% + \file{aeb_pro.sty}{\from{aeb_pro.dtx}{copyright,package}} + \file{aeblayers.def}{\from{aeb_pro.dtx}{copyright,aeblayers}} + \file{aebpro.def}{\from{aeb_pro.dtx}{copyright,aebpro}} + \file{anime_support.def}{\from{aeb_pro.dtx}{copyright,animecommon}} + \file{btnnanime.def}{\from{aeb_pro.dtx}{copyright,btnanime}} + \file{ocganime.def}{\from{aeb_pro.dtx}{copyright,ocganime}} + \file{create_icon.def}{\from{aeb_pro.dtx}{copyright,createicon}} + \file{unicodes.def}{\from{aeb_pro.dtx}{copyright,unicode}} +% \file{fsprodef.js}{\from{aeb_pro.dtx}{copyright,fsdefjs}} % commented out beginning with 2016/07/26 v2.2 +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/texmf-dist/source/latex/aeb-pro/aeb_pro.js b/texmf-dist/source/latex/aeb-pro/aeb_pro.js new file mode 100644 index 00000000..7b14a209 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/aeb_pro.js @@ -0,0 +1,130 @@ +/* + AEB Pro Document Assembly Methods + + Copyright (C) 2012 -- 2016 AcroTeX.Net + D. P. Story + http://www.acrotex.net + + Version 1.4 +*/ + +if ( typeof aebTrustedFunctions == "undefined") { + aebTrustedFunctions = app.trustedFunction( function ( doc, oFunction, oArgs ) + { + app.beginPriv(); + var retn = oFunction( oArgs, doc ) + app.endPriv(); + return retn; + }); +} +aebAddWatermarkFromFile = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.addWatermarkFromFile(oArgs); + app.endPriv(); +}); +aebImportIcon = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.importIcon(oArgs); + app.endPriv(); +}); +aebInsertPages = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + try { doc.insertPages(oArgs); } catch(e) {console.println("Error: " + e.toString());} + app.endPriv(); +}) +aebAppOpenDoc = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + try { var retn = app.openDoc(oArgs); } catch(e) {console.println("Error: " + e.toString());} + app.endPriv(); + return retn; +}) +aebImportTextData = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.importTextData(oArgs); + app.endPriv(); +}); +aebImportSound = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.importSound(oArgs); + app.endPriv(); +}); +aebSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + app.execMenuItem("Save"); + app.endPriv(); +}); +aebDocSaveAs = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.saveAs(oArgs); + app.endPriv(); +}); +aebExtractPages = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.extractPages(oArgs); + app.endPriv(); +}); +aebMailDoc = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.mailDoc(oArgs); + app.endPriv(); +}); +aebImportDataObject = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + return retn = doc.importDataObject(oArgs); + app.endPriv(); +}); +aebSignatureSign = app.trustPropagatorFunction( function ( oArgs, field ) +{ + app.beginPriv(); + return retn = field.signatureSign(oArgs); + app.endPriv(); +}); +aebSecurityHandlerLogin = app.trustPropagatorFunction( function ( oArgs, securityHandler ) +{ + app.beginPriv(); + return retn = securityHandler.login(oArgs); + app.endPriv(); +}); +aebSecurityGetHandler = app.trustPropagatorFunction( function ( oArgs, security ) +{ + app.beginPriv(); + return retn = security.getHandler(oArgs); + app.endPriv(); +}); +aebAppGetPath = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + var retn = app.getPath(oArgs); + app.endPriv(); + return retn; +}); +aebSignatureSetSeedValue = app.trustPropagatorFunction( function ( oArgs, field ) +{ + app.beginPriv(); + return retn = field.signatureSetSeedValue(oArgs); + app.endPriv(); +}); +aebAddIcon=app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + doc.addIcon(oArgs); + app.endPriv(); +}); +aebCreateTemplate = app.trustPropagatorFunction( function ( oArgs, doc ) +{ + app.beginPriv(); + try { doc.createTemplate(oArgs); } catch(e) {console.println("Error: " + e.toString());} + app.endPriv(); +}) + diff --git a/texmf-dist/source/latex/aeb-pro/doc/aebpro_man.tex b/texmf-dist/source/latex/aeb-pro/doc/aebpro_man.tex new file mode 100644 index 00000000..9799084e --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/doc/aebpro_man.tex @@ -0,0 +1,3793 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv, + forcolorpaper,latextoc,pro}, + eforms,linktoattachments,aebxmp +]{aeb_pro} +\usepackage{aeb_mlink} +\usepackage{graphicx,array} +%\usepackage{myriadpro} +%\usepackage[usecmtt]{myriadpro} +\usepackage[altbullet]{lucidbry} + +\usepackage{makeidx}\makeindex +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\urlstyle{sf} +\let\uif\textsf + +\def\tutpath{doc/tutorial} +\def\tutpathi{tutorial} +\def\expath{../examples} + +\def\verygoodbreak{% +\vskip0pt plus1in\goodbreak\vskip0pt plus-1in} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={\texorpdfstring{{\AcroEB} Professional\\[1em]} + {AcroTeX eDucation Bundle Professional: }% + Enhanced \texorpdfstring{\AEB}{AeB} Features using Acrobat Pro}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Documentation for {\AEBP} from AcroTeX}, + talksite={\url{www.acrotex.net}}, + version={v2.8a, 2017/03/08}, + Keywords={XMP, E4X, Adobe Acrobat, JavaScript}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net}, + authortitle={CEO and chief developer of AcroTeX.Net}, + descriptionwriter={Good guy, but retired} +} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-31.25pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +%\pagestyle{empty} + +%\parindent0pt \parskip\medskipamount + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.5em}} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\newcommand{\aebDescriptionlabel}[1]{% + \setlength\dimen@{\amtIndent+\labelsep}% + {\hspace*{\dimen@}#1}} +\makeatother +\newenvironment{aebDescript} + {\begin{list}{}{\setlength{\labelwidth}{0pt}% + \setlength{\leftmargin}{\leftmargin}% + \setlength{\leftmargin}{\leftmargin+\amtIndent}% + \setlength\itemindent{-\leftmargin}% + \let\makelabel\aebDescriptionlabel + }}{\end{list}} + +\def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}} +\def\AcroBlog{{Acro\!\TeX} Blog} + +\newcommand\refctan[1]{\href{http://ctan.org/pkg/#1}{ctan.org/pkg/#1}} +\newlength{\aebdimen} +\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} +\def\meta#1{\textit{\texttt{#1}}} +\let\pkg\textsf +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\def\RMA{RMA} +\let\SC\relax +\def\SWF{SWF} +\def\FLV{FLV} +\let\EXT\relax +\def\AcroFLeX{AcroF\kern-.1667em + \lower.5ex\hbox{L}\kern-.3eme\kern-.125emX\@} +\def\AEB{\textsf{AeB}} +\def\AcroTeX{Acro\!\TeX} +\def\HTML{HTML}\def\FDF{FDF} +\def\PDF{PDF}\def\URL{URL} +\let\amtIndent\leftmargini +\def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}} +\def\nhnameref#1{\bNH\nameref{#1}\eNH} +\def\nhNameref#1{\bNH\Nameref{#1}\eNH} +\def\nhurl#1{\bNH\url{#1}\eNH} +\def\grayV#1{\textcolor{gray}{#1}} +\def\darg#1{\{#1\}} +\def\parboxValign{t} +\renewcommand*{\backrefalt}[4]{% + \ifcase #1\or + See page~#2.\else See pages~#2.\fi +} +\newenvironment{aebQuote} + {\list{}{\leftmargin\amtIndent}% + \item\relax}{\endlist} +\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{% + \raisebox{.5\baselineskip+#1}{% + \expandafter\parbox\expandafter[\parboxValign]% + {\marginparwidth}{\aebbkFmtMp#2}}}} +\def\aebbkFmtMp{\hfill\kern0pt\itshape\small + \color{blue}\raggedright\hspace{0pt}} +\newcommand{\BlogArticle}{\makebox[0pt][l]{\hspace{-1pt}\color{blue}\Pisymbol{webd}{254}% + }\raisebox{.5pt}{\color{red}\ding{045}}} +\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} +\def\FitItIn{\eq@fititin} +\def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}} + +\reversemarginpar + +\def\addWatermarkFromFile#1#2{% +aebTrustedFunctions#1\theDocObject, aebAddWatermarkFromFile, #2} + + +%\definePath\bgPath{"C:/Users/Public/Documents/% +% ManualBGs/Manual_BG_Print_AeB.pdf"} +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The AeB Pro Manual"; +var manualfilename="Manual_BG_Print_aebpro.pdf"; +var manualtemplate="Manual_BG_Blue.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\section{Forward} + +For the past several years (this year is 2016), I've been writing a book +titled, +\begin{quote} +\AEBBook. +\end{quote} +The book~\cite{book:AEBB} covers {\AEB}, which includes the \pkg{eforms} +package, and {\AEBP} in \emph{great detail} and includes many examples to +illustrate concepts and techniques. Numerous new examples are available on +the CD-ROM that accompanies the book. + +During the time of the writing, each of the packages covered was examined, +bugs were fixed, and many new and major features were created. Any new +features developed in the course of writing the book are documented in the +book; however, they are \emph{not included in this documentation}. You can +either buy the yet-to-be-submitted book sometime in the future, or discover +the features by studying the DTX documentation of the program files. Sorry, +it took me three years to write the book, I don't want to spend another year +on this documentation. \verb!:-{)! + +\begin{flushright} +Dr. D. P. Story\\[3pt] +January 20, 2016 +\end{flushright} + + +\section{Overview} + +\AEBP, package file base name \texttt{aeb\_pro} +(\href{http://ctan.org/pkg/aeb-pro}{ctan.org/pkg/aeb-pro}), is an assortment +of features (see Section~\ref*{features} below) implemented through a +combination of \textbf{pdfmark} operators~\cite{tech:pdfmark}, which are +native to a PostScript file, and JavaScript techniques, some of which require +\textsf{Acrobat Professional}. These features were meant to be used with +{\AEB} (\AcroEB); in particular, the \texttt{insdljs} and \texttt{eforms} +packages are essential to {\AEBP}. To have access to all the features of +{\AEBP}, the document author must have \textsf{Acrobat Pro}~7.0 or later and +use \textsf{dvips/\penalty0 Distiller} workflow to create the {\PDF}. For the +most part, once the document is assembled, it can be viewed by \app{Adobe +Reader}~7.0 or later. + +Despite the declaration in the \textbf{Forward} to the +contrary\marginpar{\small\raggedleft v2.1 notes}, this manual will be updated +for Version~2.1 of {\AEBP} to reflect the creation of a significant new +feature, the \opt{useacrobat} option. For a document author who prefers +\app{pdflatex} (including \app{lualatex}) or +\app{xelatex}\marginpar{\small\raggedleft non-\app{Distiller} workflow}, this +option opens the features of {\AEBP} provided the document author has the +full \app{Acrobat} application and has set it up as the primary {\PDF} viewer +on his/\penalty0 her computer system. Continue reading about the +\app{useacrobat} option on page~\pageref{item:useacrobat}. The \opt{nopro} +option has changed as well, the code base that does not depend on the +\app{Acrobat} application is now available to non-\app{Distiller} workflows; +refer to the description of the \opt{nopro} option on +page~\pageref{item:nopro} for additional details. + + +\subsection{Dedication} + +This is a package that I've been meaning to write for some time, it has +had to wait for my retirement. The {\AEBP} package includes several +techniques that I've developed over the years for my personal use, and a +few new ones. The techniques require \textsf{Acrobat Pro}~7.0 or later, +as well as the \textsf{Adobe Distiller}. + +As a now former educator, I've always preferred the use of +\textsf{Acrobat}/\textsf{Distiller} over \textsf{pdftex}/\textsf{Adobe +Reader}. I recognize the debt I owe to the {\Y&Y} {\TeX} +System,\footnote{Sadly, now out of business. {\Y&Y} was a critically +important partner in my efforts: its early use of type~1 fonts made it +easy to use different fonts; its excellent dviwindo previewer---still +unsurpassed by current previewers---was an essential tool in much of what +I did, and really fired my imagination.} and to \textsf{Acrobat} and +\textsf{Distiller}.\footnote{Though \textsf{pdftex} and \textsf{dvipdfm} +are important applications and have their place in the {\LaTeX} to PDF +workflow, I found them too limiting and too slow in development. For +Acrobat, you have a team of top professional software developers working +on the Acrobat/Adobe Reader applications, as opposed to academics working +sporadically on a PDF creator. The viability of the applications +(\textsf{pdftex} and \textsf{dvipdfm}) ultimately depend on too few +individuals.} These systems have inspired me and have made it easy to +develop new ideas. I believe that if I had not used the Windows/Acrobat +platform, I would not have developed all the packages and systems that I +did.\footnote{An Internet colleague once asked me why I didn't switch over +to Linux, I responded that if I had done that, we would not know each +other. We were brought together by the software development that I did on +the Windows/Acrobat platform. Switching would have shut me down from the +beginning.} + +I dedicate \textsf{{\AEBP}} to {\Y&Y} (developer Berthold K. P. Horn) and +to Adobe Systems, developer of \textsf{Acrobat}. Since I entered the +Internet education business, I've gotten to know Berthold quite well +through our email correspondence, and many of the software engineers of +the \textsf{Acrobat} software engineering team.\footnote{In the year 2000, +I took a seven month sabbatical in San Jos\'e, CA, and worked on the +\textsf{Acrobat} software engineering team, for \textsf{Acrobat}~5.0. Good +memories from my days with Adobe remain. I made good friends there.} Thank +you all for your wonderful work. + +\subsection{Features}\label{features} + +As you might discern from the table of contents, this package features: +\begin{enumerate} + \item {\AEB} Central Control: A uniform way of handling the packages in + the Acro\!{\TeX} Family of Software. + \item Supports all fields in the Initial View tab of the Document Properties + dialog box. + \item Complete support for document level JavaScripts and for document actions. + \item Complete support for page actions, both open and close events. + \item Complete support for fullscreen mode. + \item Support for attaching documents, and for linking to and for launching embedded files. + \item Support for creating a PDF Package, new to version 8 of + \textsf{Acrobat}. + \item Support for what I call document assembly methods, which I've found to be very useful + through the years. (This technique was developed in the year 2000 while I was out in + San Jos\'{e}.) + \item Support for the use of Optional Content Groups, rollovers and animations. +\end{enumerate} +I anticipate future developments. + +\subsection{Sample Files and Articles}\label{s:samplefiles} + + +The basic distribution demonstration files are available from the +\href{http://www.math.uakron.edu/~dpstory/aeb_pro.html}{\AEBP} +website.\footnote{\url{\bUrl/aeb_pro.html}} + +\paragraph*{\AcroBlog.}\label{para:AcroBlog} The basic examples from the distribution are also available +from the \AcroBlog, accessible from the page +\href{http://www.acrotex.net/blog/?cat=98}{{\AEBP} Demo Files}.\footnote{\url{http://www.acrotex.net/blog/?cat=98}} +There is another more recent collection of examples on +\href{\urlAcroTeXBlog}{\AcroTeX{} Blog}, these will be referenced in the margin using the icon %\exAeBBlogPDF +\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}% + \raisebox{-2pt}{\color{red}{{\zqacr b\hspace{9.5pt}}}}}\,, whereas +\mbox{\makebox[0pt][l]{\hspace{-1pt}\textcolor{blue}{\Pisymbol{webd}{254}}}% +\raisebox{.5pt}{\color{red}{\ding{045}}}} refers to a written blog +article. In all cases, the source file and any dependent resources are attached to the +PDF. A listing of all examples that have the \textit{\href{\urlAcroTeXBlog/?tag=aeb-pro}{aeb-pro}} +tag.\footnote{\url{\urlAcroTeXBlog/?tag=aeb-pro}} + + +%\exAeBBlogPDF{p=877} See the file \texttt{\href{\urlAcroTeXBlog/?p=877}{bgtest.pdf}}. + + +\subsection{Requirements} + +To open this package up to a wider population of users, the requirements for +this package have changed; the document author is no longer required to own +the \app{Acrobat} application (strongly recommended) and is no longer +required to use the \app{dvips/Distiller} workflow, as previous versions have +required. This package classifies you, as the document author, into one of +three groups: +\begin{enumerate} + \item You own \app{Acrobat} and use the \app{dvips/\penalty0 Distiller} + workflow. This is the ideal workflow for this package because all + features of this package are available. + \item You own \app{Acrobat} but prefer to use a non-\app{Distiller} + workflow; that is, you prefer to use the applications + \app{pdflatex}, \app{lualatex}, or \app{xelatex}. In this case, + almost all features are available through the \opt{useacrobat} + option, refer to the initial description of this option on + page~\pageref{item:useacrobat}. + \item You do not own \app{Acrobat}, your {\PDF} creator must be + \app{pdflatex}, \app{lualatex}, or \app{xelatex}. To avoid compile + errors, you must use the \opt{nopro} option, read the initial description + of this option on page~\pageref{item:nopro}. +\end{enumerate} +If you do own \app{Acrobat}, it must be version~7 or later; to repeat, +$$ +\boxed{\text{\textbf{\textsf{Acrobat~7.0 Professional}} or later is required}} +$$ +If you do not own \app{Acrobat} and you want to access the extensive features +of {\AEBP} beyond what the \opt{nopro} option provides, you need to buy the +application.\footnote{In the United States and Europe, Adobe offers a +significant academic discount on its software, including \app{Acrobat +Pro}. Educators should look into the price structure of \app{Adobe Acrobat} +at their institutions; perhaps, their Department or College can supply a +financial grant for the purchase of the software.} Once the document is +built, however, \textsf{\textbf{Adobe Reader~7.0}} (or later) is sufficient +to view the document. This is a reasonable restriction since some JavaScript +techniques used by this package require \app{Acrobat Pro}. + +\textbf{{\AEBP}} requires the \pkg{insdljs} and +\pkg{eforms} packages, both of which are included with the +\textbf{\AcroEB} (\AEB) distribution. The use of the {\Web} package +is optional, though highly recommended. These are all meant to fit +together as a comprehensive and unified family of packages, after all. + +\newtopic Below is a list of other required packages used by the \AEBP: +\begin{enumerate} + \item \textsf{hyperref}: The \textsf{hyperref} bundle should be + already on your system, it is standard to most {\LaTeX} distributions. + + \item \texttt{xkeyval}: The very excellent package by Hendri + Adriaens. This package allows developers to write commands + that take a variety of complex optional arguments. You should + get the most recent version, at this writing, the latest is + v2.5e, or later. + + \item \texttt{xcolor}: An amazing color package by Dr. Uwe Kern. + This package makes it easy to write commands to dim the color. + Get a recent version, at this writing, the latest is v2.08 + (2005/11/25). + + \item \texttt{truncate}: This package, by Donald Arseneau, is used in the navigation panel to abbreviate the + section titles if they are too wide for the panel. This package is distributed with + the \APB. + + \item \texttt{comment}: A general purpose package, Victor Eijkhout, for creating environments that can be + included in the document or excluded as comments. A very useful package for {\LaTeX} + package developers. This package is distributed with the \APB. + + \item \texttt{eso-pic} by Rolf Niepraschk and \texttt{everyshi} by Martin Schr\"oder, these are used + by {\Web} to create background graphics and graphic overlays. +\end{enumerate} +One of the extremely nice features of \textbf{MiK\TeX} is +that it can automatically download and install any unknown packages +onto your hard drive, so getting the {\AEBP} up and running is not a +problem! + +\subsection{The {\AEBP} Family of Software} + +To qualify to be a member of the `{\AEBP} Pro' family, a package must require \app{Acrobat Distiller} +as the PDF creator. We list many of the members of this exclusive family. + +\begin{description}\def\NH{\hspace*{-\labelsep}} + \item\NH\pkg{aebxmp} is a {\LaTeX} package (\refctan{aebxmp}) that + fills in the advance metadata. The package requires \app{Acrobat}~8 + Professional and uses \SC{E4X}, the \SC{XML} parser that is built + into the JavaScript engine. + + \item\NH\pkg{rmannot} (\refctan{rmannot}) creates rich media + annotations (\RMA), which may embed or stream {\SWF}, {\FLV}, and + \EXT{MP3} files for playing while a document is being read. + + Rich media annotation is a feature of \app{Acrobat}/\app{Adobe + Reader}, version~9 or later. \app{Acrobat Pro} and \app{Acrobat + Distiller} (version~9 or later) are required to build a document, and + \app{Adobe Reader} (version~9 or later) is needed to activate the + annotation and play the media. + +\item\NH \app{\AcroFLeX} is an application of the \pkg{rmannot} package + briefly described above. The \pkg{acroflex} package + (\refctan{acroflex}) creates a graphing screen. The user can type in + functions and graph them. A graphing screen can be populated with + pre-packaged functions for the user to scrutinize and interact with. + The package can graph functions of a single variable $x$, a pair of + parametric equations that are functions of $t$, and a polar function of + $t$. + + The graphing screen is a rich media annotation that uses a specially + developed {\SWF} file, called the {\AcroFLeX} Graphing widget. The package + takes advantage of rich media annotations, a version~9 feature of + \app{Acrobat}; it therefore requires \app{Acrobat Pro and Distiller} + version 9 or later. The user needs to use \app{Adobe Reader} (version~9.0 + or later) in order to obtain the graphing functionality. + + \item\NH \pkg{aeb\_mlink} (\refctan{aeb-mlink}) + creates hypertext links in documents for text extending over + \emph{multiple lines}. The package requires that the {\PDF} be + created by \app{Acrobat Distiller}, version~7.0 or later to create + multi-line links, and requires \app{Adobe Reader}~7.0 or later for + the links to work correctly. + + \item\NH\pkg{annot\_pro} (\refctan{annot-pro}) is used to + create text, stamp, and file attachment annotations using + \app{Acrobat Distiller} that can then be viewed in \app{Adobe + Reader}. + + \item\NH \pkg{graphicxsp} (\refctan{graphicxsp}) embeds a graphic file in + a {\PDF} document in such a way that the author may reuse that same + graphics without significantly increasing the file size. The + package also supports the Adobe transparency model. +\end{description} +The next three packages are less important, some are ``novelty'' packages. +\begin{description}\def\NH{\hspace*{-\labelsep}} + + \item \NH\pkg{acrosort} (\refctan{acrosort}) is a novelty package for + importing an image that has been sliced into rows and columns and + randomly rearranged. The JavaScript does a bubble sort on the + picture. + + \item \NH \pkg{{\AEB} Slicing} is a batch sequence + (\refctan{aebslicing}) for \app{Acrobat Pro} that takes the image + open in \app{Acrobat} and slices it into a specified number of rows + and columns, and saves the slices to a designated folder. It is + used for the \pkg{acromemory} package. + + \item \NH \pkg{acromemory} is a {\LaTeX} package (\refctan{acromemory}) + that implements two variations of a memory game: (1) a single game + board consisting of a number of tiles, each tile has a matching + twin, the object is to find all the matching twins; (2) two game + boards, both identical except one has been randomly rearranged, the + object is the find the matching pieces in each of the two game + boards. The \pkg{{\AEB} Slicing} is used to slice the image into a specified + number of rows and columns. +\end{description} +These, as well as the {\AEBP} distribution itself, are available through CTAN +or the {\AEBP} family website: +\begin{equation*} + \text{\url{www.math.uakron.edu/~dpstory/aeb_pro.html}} +\end{equation*} + + +\subsection{Package Options} + +Below is a list of all options of the {\cAEBP} package: +\begin{description} + \item [\texttt{driver=\anglemeta{driver}}\enspace] The permissible values + of \anglemeta{driver} are \opt{dvips}, \opt{dvipsone}, \opt{pdftex}, + and \opt{xetex}. The latter two are automatically detected and need + not be specified. If no detectable driver is identified and no driver + is given, \opt{dvips} is assumed. + + \item [\texttt{useacrobat}\enspace]\label{item:useacrobat} For those who prefer to use + \app{pdflatex} (or \app{lualatex}) or \app{xelatex} \emph{and} who + own the \app{Acrobat} application, use the \opt{useacrobat} option to + open all features of this package except for any features associated + with the \app{uselayers} option. The creation of layers is still only + supported through the \textbf{pdfmark} operator. + + As you go through the examples provided by this package, all sample + files work except for the ones using the \opt{uselayers} or + \opt{ocganime} option. + + Continue reading about the \opt{useacrobat} option in Section~\ref{useacrobatOpt}. + + \item [\texttt{nopro}\enspace]\label{item:nopro} If this option is taken, + then no code that requires \app{Distiller} or \app{Acrobat} is input. + Authors who use \app{pdflatex/\penalty0 lualatex/\penalty0 xelatex} + and who do not own the \app{Acrobat} application may have access to + the `nopro' features by taking the \opt{nopro} option. + + Continue reading about the \opt{nopro} option in + Section~\ref{s:noproOpt}. + + + \item [{\AEBP} Options\enspace] The {\cAEBP} package recognizes the + components of {\AEB}, these are \texttt{web}, \texttt{exerquiz}, + \texttt{dljslib}, \texttt{eforms}, \texttt{insdljs}, + \texttt{eq2db}, \texttt{aebxmp}, + \texttt{graphicxsp}, \texttt{hyper\-ref}. The value of each of these is a list of + options you want that package to use. (The hyperref package is not + a component of {\AEB}, but it is such an integral part of {\AEB} that it + is included.) See \hyperref[AeBCC]{Section~\ref*{AeBCC}}, + page~\pageref*{AeBCC}. + + \item [\texttt{gopro}\enspace] Some components of {\AEB} have a pro option, + when you use the gopro option of {\cAEBP}, the \texttt{pro} option + is passed to all components of {\cAEBP} that have a \texttt{pro} + option. + + \item [\texttt{attachsource}\enspace] This key has as its value a list of + extensions. For each extension listed, the file \cs{jobname.ext} + will be attached to the parent PDF. See + \hyperref[attachsource]{Section~\ref*{attachsource}}, + page~\pageref*{attachsource}. + + \item [\texttt{attachments}\enspace] This key has its value a list of paths + to files to be attached to the parent document. See + \hyperref[attachments]{Section~\ref*{attachments}}, + page~\pageref*{attachments}. + + \item [\texttt{linktoattachments}\enspace] Invoking this option causes code + for linking to attachments, or for giving attachments descriptions + other than the default ones. See + \hyperref[linktoattachments]{Section~\ref*{linktoattachments}}, + page~\pageref*{linktoattachments}. + + %\item [\texttt{latin1}\enspace] A companion option to \texttt{linktoattachments}. When this + % option is used, the set of latin1 unicodes are input and are + % available to be used in the descriptions of attachments. + % See `\nameref{description}' on page~\pageref*{description}. + + \item [\texttt{childof}\enspace] In a {\LaTeX} child document, use this + option to set the path back to the parent document. See + \hyperref[childof]{Section~\ref*{childof}}, + page~\pageref*{childof}. + + \item [\texttt{btnanime}\enspace] When this option is taken, the code for button + animation is included in the compilation. See + \hyperref[s:btnanime]{Section~\ref*{s:btnanime}}, + page~\pageref*{s:btnanime} for details. + + \item [\texttt{uselayers}\enspace] Taking this option brings in code in + support of Optional Content Groups, see + \hyperref[layers]{Section~\ref*{layers}}, page~\pageref*{layers}. + + + \item [\texttt{ocganime}\enspace] When this option is taken, the code for + ocg animation is included in the compilation. See + \hyperref[ss:ocganime]{Section~\ref*{ss:ocganime}}, + page~\pageref*{ss:ocganime} for details. + +\end{description} + +%\verygoodbreak + +\subsection{Installation} + +%The {\AEB} distribution comes in two ZIP files: \texttt{acrotex\_pack} and +%and \texttt{acrotex\_exdoc}. The former contains the program files and +%documentation, and the latter contains example files and other documentation. +%Instructions for installing and unpacking the distribution follow. + +{\AEBP} requires the installation of {\AEB} +(\href{http://ctan.org/pkg/acrotex}{ctan.org/pkg/acrotex}). Be sure to +install {\AEB} and to read the installation instructions. In this section, we +outline the method of installing {\AEBP}. + +\subsubsection{Automatic installation} + +Some {\TeX} systems, most notably \textbf{MiK\TeX} and \textbf{{\TeX} Live}, +have a Package Manager to automatically download and install {\LaTeX} +packages. If you have a Package Manager and not installed {\AEBP} do so now. +After {\AEBP} is installed, it is not quite ready to be used. Locate where +the Package Manager installed the documentation portion of the installation, +for MiK\TeX, this might be at +\begin{Verbatim}[xleftmargin=\amtIndent] +C:\Program Files (x86)\MiKTeX 2.9\doc\latex\aeb-pro +\end{Verbatim} +(This path assumes the use of \textbf{MiK\TeX~2.9}.) The folder contains documentation and example files. If also contains the two +JavaScript files, \texttt{aeb.js} and \texttt{aeb\_pro.js}. Refer to +\nhNameref{ss:aebpjs} for more information on the installation of these two files. + +\subsubsection{Manual installation} + +Manual installation may be necessary for some {\TeX} systems, or for the case +where you have downloaded the ZIP package files from CTAN or from the home website of +{\AEBP} at \url{\bUrl/aeb_pro.html}. + +The {\AEBP} distribution comes in two ZIP files: \texttt{aebpro\_pack.zip} +and \texttt{aebpro.zip}. The first contains the program files and +documentation,\footnote{Available from \url{\bUrl/aeb_pro.html}} the latter +contains the full distribution, including program files, documentation, and +example files. If you already have {\AEBP}, it suffices to update your +installation using \texttt{aebpro\_pack.zip}. If you don't have {\AEBP} +already installed, the install the contents of \texttt{aebpro.zip}. + +\newtopic To install {\AEBP}, use the following steps: +\begin{enumerate} +\item Place \texttt{aebpro.zip} (or possibly \texttt{aebpro\_pack.zip}) on your latex search file + and unzip. (If you already have an \texttt{aeb\_pro} folder, unzip + one level above the \texttt{aeb\_pro} folder.) Unzipping creates + a folder named \texttt{aeb\_pro}. + +\item[] \textbf{Installing {\AEBP} with MiK\TeX{} 2.8 or later.} + {MiK\TeX}~2.8 or later is more particular about where you install + packages by hand. If you are installing {\AEBP} by hand, {MiK\TeX}~2.8/2.9 + requires that you install the distribution in a local root TDS tree. + Review the {MiK\TeX} help page on this topic + \begin{equation*} + \text{\url{http://docs.miktex.org/manual/localadditions.html}} + \end{equation*} + Within \verb!C:\Local TeX Files\tex\latex!, copy + \texttt{aebpro\_pack.zip} (and possibly \texttt{aebpro.zip}) and unzip. Unzipping creates a folder + named \texttt{aeb\_pro}. + +\item[] If you already have {\AEBP} that was automatically installed on your {MiK\TeX} + system, you should delete this old version of {\AEBP}. You may have to use the + {MiK\TeX} package manager to remove them from the {MiK\TeX} database registry. + +\item Within the \texttt{aeb\_pro} folder, latex the file \texttt{aeb\_pro.ins} file, this unpacks + the installation. + +\item[] Users of \textbf{MiK\!\TeX} need to refresh the filename database. + +\item Install the JavaScript file, \texttt{aeb\_pro.js}, as explained in the next subsection. +\end{enumerate} + +\noindent{\AEB} (\AcroEB) is also required, installation instructions are contained +in the {\AEB} reference document, the instructions are reproduced here for your convenience. + +\newtopic To install {\AEB}, use the following steps: +\begin{enumerate} +\item Place \texttt{acrotex.zip} in your latex search file and unzip. (If + you already have an \texttt{acrotex} folder, you should unzip the file + \texttt{acrotex.zip} one level above the \texttt{acrotex} folder.) + Unzipping creates a folder named \texttt{acrotex}. + +\item[] \textbf{Installing {\AEB} with {MiK\TeX} 2.8 or later.} {MiK\TeX} is more particular + about where you install packages by hand. If you are installing + {\AEB} by hand (recommended), {MiK\TeX} requires that you install the distribution + in a local root TDS tree. Review the {MiK\TeX} help page on this topic + \begin{equation*} + \text{\url{http://docs.miktex.org/manual/localadditions.html}} + \end{equation*} + Within the local root folder, e.g., + \texttt{C:\string\Local\ TeX Files\string\tex\string\latex}, copy the file \texttt{acrotex.zip} and unzip it. + Unzipping creates a folder named \texttt{acrotex}. + +\item[] If you already have {\AEB} that was automatically installed on your {MiK\TeX} + system, you should delete this old version of {\AEB}. You may have to use the + {MiK\TeX} Package M anager to remove them from the {MiK\TeX} database registry. + +\item Within the \texttt{acrotex} folder, latex the file + \texttt{acrotex.ins} file, this unpacks the installation. + +\item[] Users of \textbf{MiK\!\TeX} need to refresh the filename database. + +\item Install the JavaScript file, \texttt{aeb.js}, as explained in the next subsection. +\end{enumerate} + + +\subsubsection{Installing \texttt{aeb\_pro.js} and \texttt{aeb.js}}\label{ss:aebpjs} + +The instructions for installing the JavaScript support files +\texttt{aeb\_pro.js} and \texttt{aeb.js} are in the +\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, which resides in +the \texttt{doc} folder of the \texttt{aeb\_pro} installation. + +After you've installed the JavaScript files, as directed by the +\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, validate the +installation of the JavaScript files by navigating to the \texttt{examples} +subfolder and opening the file \texttt{test\_install.pdf} in \app{Acrobat}; +follow the directions contained on that one page document. + +\begin{comment} + +The JavaScript methods used by the \texttt{docassemble} environment, see +\mlNameref{docassembly}, have a security setting in \textsf{Acrobat}; +\textsf{Acrobat} requires that such methods be \emph{trusted methods}. The +file \texttt{aeb\_pro.js} enables you to execute the doc assembly methods +described later without \textsf{Acrobat} raising security exception. + +The JavaScript file \texttt{aeb.js}, which comes with {\AEB}, is only ~needed +if you use \textsf{Acrobat Pro}~8.1 or later. Increased security in that +version has made it necessary to install a folder JavaScript file to be +able to install document level JavaScripts. + + +\paragraph*{Acrobat Pro~8.1 or later.} Start \textsf{Acrobat Pro}~8.1 or +later, and open the console window \textsf{Advanced \texttt> JavaScript +\texttt> Debugger} (\texttt{Ctrl+J}). Copy and paste the following code +into the window. +\begin{Verbatim} + app.getPath("user","javascript"); +\end{Verbatim} +Now, this the mouse cursor on the line containing this script, press +the \texttt{Ctrl+Enter} key. This will execute this JavaScript. This +JavaScript method returns the path to where \texttt{aeb.js} and +\texttt{aeb\_pro.js} should be placed. For example, on my system, +the return string is +\begin{Verbatim}[fontsize=\small] + /C/Documents and Settings/story/ + Application Data/Adobe/Acrobat/8.0/JavaScripts +\end{Verbatim} +Follow the path to this folder. If the \texttt{JavaScripts} folder does +not exist, create it. Finally, copy both \texttt{aeb.js} and +\texttt{aeb\_pro.js} into this folder. Close \textsf{Acrobat}, the next +time \textsf{Acrobat} is started, it will read in the to \texttt{.js} +files. + +\paragraph*{Acrobat Pro~10.1.1.} For this version of \textsf{Acrobat}, +things have tightened up even more. The user JavaScripts folder has moved to +\begin{Verbatim}[fontsize=\small] + %AppData%\Adobe\Acrobat\Privileged\10.0\JavaScripts +\end{Verbatim} +where \verb!%AppData%! is an environment variable defined by Acrobat. For details +of how to install the folder JavaScripts in the new location, see my blog +article \mlhref{http://www.acrotex.net/blog/?p=737}{Acrobat Security Changes in 10.1.1 and +Acro\!\TeX}. + +\end{comment} + +\subsubsection{Installing \texttt{aebpro.cfg}} + +The distribution comes with a file named \texttt{aebpro.cfg}, the +contents of which are displayed below: +\begin{Verbatim} +% +% AeB Pro Configuration file +% +\ExecuteOptionsX{driver=dvips} +\end{Verbatim} +Locate this file in the root folder of the {\AEBP} installation. If the +driver is specified in the configuration file, it need not be included in the +option list of \texttt{aeb\_pro}. + + +\subsection{Examples} + +The following is a list of the example files that illustrate and +test various features of {\AEBP}. + +\begin{enumerate} + \item \texttt{\href{\urlAcroTeXBlog/?p=1237}{aebpro\_ex1.tex}}: Illustrates the document and page + open/close actions and full screen support of {\AEBP}. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1242}{aebpro\_ex2.tex}}: Demonstrates the features of the + \texttt{pro} option of the \textsf{web} package, including enhanced control + over the layout of section headings and the title page. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1245}{aebpro\_ex3.tex}}: Highlights the various attachment options and the + doc assembly methods. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1251}{aebpro\_ex4.tex}}: A discussion of layers, rollovers + and animation. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1257}{aebpro\_ex5.tex}}: This file discusses linking to attachments + and covers commands \cs{ahyperref}, \cs{ahyperlink} and + \cs{ahyperextract}. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1263}{aebpro\_ex6.tex}}: Learn how + to create a PDF Package out of your attachments. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1266}{aebpro\_ex7.tex}}: + Explore the \cs{DeclareInitView} command, documentation included in + this file. + + \item \texttt{\href{\urlAcroTeXBlog/?p=1268}{aebpro\_ex8.tex}}: Details + of how to use unicode to set the initial value(s) of field, or as + captions on a button. +\end{enumerate} +These sample files are available in the \texttt{examples} folder of the +\texttt{aeb\_pro} folder. When links given above are to the same files on the +{\AcroBlog}. + +\exPDFSrc{aebpro_ex1} Throughout this document, the above exercises are +referenced using icons in the left margins. These icons are live hyperlinks +to the source file or the PDF. For example, we reference \texttt{aebpro\_ex1} +in this paragraph. The example files can be found in the \texttt{examples} +sub-folder of the \texttt{aeb\_pro} distribution. Alternatively, if the above +links do not work because you have moved this documentation, you can also +access the basic distribution examples from the {\AcroBlog} website, refer to +the named paragraph \textbf{\nhnameref{para:AcroBlog}}\FmtMP{\BlogArticle} on page~\pageref{para:AcroBlog} +for links to this resource. + +\section{Concerning the +\texorpdfstring{\protect\opt{useacrobat}}{useacrobat} +option}\label{useacrobatOpt} + +For document authors who have the full \app{Acrobat} application but prefer a +non-\app{Distiller} workflow, use the \opt{useacrobat} option to declare to {\AEBP} +that you have \app{Acrobat}. Traditionally, if neither \app{pdflatex} +(including \app{lualatex}) nor \app{xelatex} are used, a \app{dvips/\penalty0 +Distiller} workflow is assumed. Declaring the \opt{useacrobat} option opens +up all features except for those that depend on the use of layers (also +called {\EXT{OCG}s); in particular, the options \opt{uselayers} and +\opt{ocganime} are disallowed}. All features, therefore, described in this +manual are available to \app{pdflatex} and \app{xelatex} document authors who +have \app{Acrobat}, \emph{except for those features} described in +Section~\ref{layers} and Section~\ref{ss:ocganime}. + +\paragraph*{Syntax.} The syntax for this option is simple: +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\usepackage[!textbf(useacrobat), + !meta(options) +]{aeb_pro} +\end{Verbatim} +where \meta{options} \emph{does not include} the +\opt{uselayers} and \opt{ocganime} options. + +\newtopic +Regarding \app{{\AEB} Control Central} (Section~\ref*{AeBCC}), when you +specify \opt{useacrobat},\footnote{This implies you are not using +\opt{Distiller} as the {\PDF} creator.} the packages \pkg{graphicxsp} and \pkg{rmannot} of +display~\eqref{display:ACCopts} are not allowed to be specified in the option +list of \pkg{aeb\_pro}. These two packages use the \textbf{pdfmark} operator +to implement their features; a \app{dvips/\penalty0 Distiller} workflow is +required in this case. + +\section{The \texorpdfstring{\protect\opt{nopro}}{nopro} option}\label{s:noproOpt} + +For authors \emph{who do not have} the \app{Acrobat} application, you must +use \app{pdflatex} (or \app{lualatex}) or \app{xelatex} to produce your +{\PDF}. The only option for using {\AEBP} is to specify the \opt{nopro} +option. + +\paragraph*{Syntax.} The syntax for \opt{nopro} is to declare it +in the option list: +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\usepackage[!textbf(nopro), + !meta(options) +]{aeb_pro} +\end{Verbatim} +Specifying this option excludes the use of layers (the options +\opt{uselayers} and \opt{ocganime} are prohibited) and any commands or +environments that use `post-{\PDF} creation' methods\index{post-PDF creation +methods!referenced} will silently (or not so silently) fail. All features are +available that are implemented using {\LaTeX} that does not depend on the +driver, or {\LaTeX} that is driver dependent. These include the commands and +environments of Sections~\ref{AeBCC}--\ref{FSSupport}. + + +\section{\texorpdfstring{\AEB}{AeB} Control Central}\label{AeBCC} + +The {\AEB} family of software, {\LaTeX} packages all, are for the most +part stand alone; however, usually they are used in combination with +each other, at least that is the purpose for which they were +originally designed. When several members of family {\AEB} are used, +they should be loaded in the optimal order. With {\cAEBP}, you can +now list the members of the {\AEB} family you wish to use, along with +their optional parameters you wish to use. +The {\AEB} components supported by {\AEBP} are listed below. +\begin{equation} +\begin{tabular}{lllll} +\pkg{web}&\pkg{exerquiz}&\pkg{dljslib}&\pkg{eforms}&\pkg{insdljs}\\\relax +\pkg{eq2db}&\pkg{aebxmp}&\pkg{hyperref}&\pkg{graphicxsp}&\pkg{rmannot} +\end{tabular}\label{display:ACCopts} +\end{equation} +The phrase `\app{{\AEB} Control Central}' refers to using these package names +as options for the \pkg{aeb\_pro} package. Simply listing a component will +cause {\cAEBP} to install that component with its default optional +parameters; by specifying a value---a list of options required---will cause +{\cAEBP} to load the package with the listed options. + + +\Ex{} Below is a representative example of the use of the {\AEB} +options of {\AEBP}, {\AEB} Control Central! + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily web=\darg{pro,designv,tight,usesf,req=2016/11/03},}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\usepackage[% + driver=dvips, + web={pro,designv,tight,usesf,req=2016/11/03}, + exerquiz={!anglemeta(pkg-opts)}, + ..., + aebxmp +]{aeb_pro}[2016/12/10] +\end{dCmd*} +\egroup\noindent Yes, yes, I know this is not necessary, you can always load the +packages earlier than {\cAEBP}, but please, humor me. + +Beginning with \pkg{aeb\_pro} dated 2016/12/10, a new \texttt{req} key is +defined for the values of the {\AEB} packages listed in +display~\eqref{display:ACCopts}. Using the \texttt{req} you can specify the +release date (required date) of the {\AEB} package being used; this assures +that the document will compile and any new JavaScript code is present. In the +example above, the \pkg{web} package is required for release date of +2016/11/03 (or later); the \pkg{aeb\_pro} release date of 2016/12/10 is +required, for that is the date this \texttt{req} key was implemented. The +\texttt{req} key is optional. + +By default, the code for supporting features that require the use of +\textsf{Distiller} and \textsf{Acrobat~Pro} are included; there is a +\texttt{nopro} option that excludes these features. Use the \texttt{nopro} +if you only wish to use the {\AEB} Control Center feature to load the various +members of the {\AcroTeX} family. If \texttt{nopro} is used, {\AEBP} can +be used with \textsf{pdftex} and \textsf{xetex}, for example. Of course, if you +own the \app{Acrobat} application, a subset of features are available, as discussed +Section~\ref{useacrobatOpt}, using the \opt{useacrobat} option. + +See the new {\AEB} manual for documentation on the \texttt{pro} option of +\Web. The support document \texttt{aebpro\_ex2} also presents a tutorial +on the \texttt{pro} option. + +\exPDFSrc{aebpro_ex2} The support file \texttt{aebpro\_ex2} has a +section discussing the {\AEB} Control Central, as well as features of +the \opt{extended} (\opt{pro}) option of the {\Web} package. + +\section{Declaring the Initial View} + +The \Com{DeclareInitView} command is a ``data structure'' for setting the +\uif{Initial View} of the \uif{Document Propertie}s dialog box, see +\hyperref[docprops]{Figure~\ref*{docprops}}. \cs{DeclareInitView} takes up to +three key-value pairs, the three keys correspond to the three named regions +of the UI (User Interface): +\begin{center}\setlength{\extrarowheight}{2pt} +\begin{tabular}{|ll|}\hline +Key & User Interface Name\\\hline +\texttt{layoutmag} & Layout and Magnification\\ +\texttt{windowoptions} & Window Options\\ +\texttt{uioptions} & User Interface Options\\\hline +\end{tabular} +\end{center} + +The values of each these three are described in the tables below: + +\begin{itemize} + + \item \texttt{layoutmag}: This key sets the initial page layout and magnification + of the document. The values of this key are themselves key-values: + + \begin{small}\setlength{\extrarowheight}{3pt} + \begin{tabular}{|>{\ttfamily}l>{\ttfamily\raggedright}p{1.85in}>{\raggedright}p{2.06in}|}\hline + \multicolumn{1}{|l}{Key} &\multicolumn{1}{l}{Value(s)} & Description \tabularnewline\hline + navitab & UseNone,\,UseOutlines, UseThumbs,\,UseOC, UseAttachments + & The UI for these are: Page Only, Bookmarks Panel and Page, Pages Panel and Page, Layers Panel and Page, Attachments Panel and Page, respectively. The default is \texttt{UseNone}\tabularnewline + pagelayout & SinglePage,\,OneColumn, TwoPageLeft, TwoColumnLeft, TwoPageRight, TwoColumnRight + & The UI for these are: Single Page, Single Page Continuous, Two-Up (Facing), Two-Up Continuous (Facing), Two-Up (Cover Page), Two-Up Continuous (Cover Page), respectively. The default is user's preferences.\tabularnewline + mag & ActualSize,\,FitPage, FitWidth,\,FitHeight, FitVisible, \textrm{or}\ \anglemeta{pos~num} + & The UI for these are: Actual Size, Fit Page, Fit Width, Fit Height, Fit Visible, respectively. If a positive number is provided, this is interpreted as a magnification percentage. The default is to use user's preferences.\tabularnewline + openatpage & \anglemeta{pos~num} + & The page number (base 1) to open the document at. Default is page 1.\tabularnewline\hline + \end{tabular} + \end{small}% + + \newtopic\textbf{\textcolor{red}{Important:}} When you set + \texttt{openatpage} to a page number other than the first page, be + aware that document level JavaScripts are initially imported into the + document on the first page. After the file is distilled and the + document opens to the page set by \texttt{openatpage}, the document + author needs to go to page 1, at which point the document level + JavaScripts will be imported. After import, \emph{save the document}, + which will save the newly imported JavaScripts with the document. + + \item \texttt{windowoptions}: The Window Options region of the + Initial View tab consists of a series of check boxes which, when + checked, modify the initial state of the document window. These are + not really Boolean keys. If the key is present, the + corresponding box in the UI will be checked, otherwise, the box + remains cleared. + + \newtopic\begingroup\setlength{\extrarowheight}{2pt}% + \begin{tabular}{|>{\ttfamily}lp{2in}|}\hline + Key & Description \\\hline + fit & Resize window to initial page\\ + center & Center window on screen \\ + fullscreen & Open in Full Screen mode\\ + showtitle & Show document title in the title bar\\\hline + \end{tabular}\endgroup + + \newtopic Note that you can open the document in Full Screen mode using + the \texttt{fullscreen} key above, or by using the + \texttt{fullscreen} key of the \cs{setDefaultFS}. Either will + work. + + \item \texttt{uioptions}: The User Interface Options region of + the Initial View tab consists of a series of check boxes which, + when checked, hide an UI control. These are not really Boolean + keys. If the key is present, the corresponding box in the UI + will be checked, otherwise, the box remains cleared. + + \newtopic\begingroup\setlength{\extrarowheight}{2pt}% + \begin{tabular}{|>{\ttfamily}lp{2in}|}\hline + Key & Description \\\hline + hidemenubar & Hide menu bar\\ + hidetoolbar & Hide tool bars\\ + hidewindowui & Hide window controls\\\hline + \end{tabular}\endgroup + +\end{itemize} +\textbf{\color{red}Important:} The \pkg{hyperref} package can set some of +these fields of the \uif{Initial View} tab +(\hyperref[docprops]{Figure~\ref*{docprops}}). The document author is +\emph{discouraged} from using \pkg{hyperref} to set any of these fields, +though, usually they are overwritten by this package. + +\Ex{} We set the Initial View tab of the Document Properties dialog +box. +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily uioptions=\darg{hidetoolbar,hidemenubar,hidewindowui}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\DeclareInitView +{% + layoutmag={mag=ActualSize,navitab=UseOutlines,% + openatpage=3,pagelayout=TwoPageLeft}, + windowoptions={fit,center,showtitle,fullscreen}, + uioptions={hidetoolbar,hidemenubar,hidewindowui} +} +\end{dCmd*} +\egroup + +\exSrc{aebpro_ex7}The file \texttt{aebpro\_ex7} is a test file for the +features of this section. Use it to explore the properties of the +\uif{Initial View} tab (\hyperref[docprops]{Figure~\ref*{docprops}}) of the +\uif{Document Properties} dialog box. + +\begin{figure}[ht]\centering + \includegraphics[scale=0.5]{docprops} + \caption{Initial View of Document Properties}\label{docprops} +\end{figure} + +\newtopic\indent +\cs{DeclareInitView} is a companion command to \cs{DeclareDocInfo}. +Each fills in a separate tab of the Document Properties dialog box. +Use the package \Index{aebxmp} to fill in advance metadata through +\cs{DeclareDocInfo}. The \cs{DeclareInitView} commands populates +the \uif{Initial View} tab of the \uif{Document Properties} dialog box, +shown in \hyperref[docprops]{Figure~\ref*{docprops}}. + +\section{Document Actions} + +In this section we outline the various commands and environments for +creating document and page actions for a PDF document. + +\subsection{Document Level JavaScripts} + +The creation of document level JavaScript has been a part of {\AEB} for many +years, use the \texttt{insDLJS} environment, as documented in +\texttt{aeb\_man.pdf}. + +\exPDFSrc{aebpro_ex1} The document \texttt{aebpro\_ex1} offers an +example of the use of the \texttt{insDLJS} environment. + +\subsection{Set Document Actions} + +The {\cAEBP} provides environments for the \textsf{Acrobat} events +\Index{willClose}, \Index{willSave}, \Index{didSave}, \Index{willPrint} +and \Index{didPrint}. Corresponding {\LaTeX} environments are created: +\texttt{willClose}, \texttt{willSave}, \texttt{didSave}, +\texttt{willPrint} and \texttt{didPrint}. + +\exPDFSrc{aebpro_ex1} The example document \texttt{aebpro\_ex1} +includes examples of the use of the \texttt{willClose}, +\texttt{will\-Save}, \texttt{didSave}, \texttt{willPrint} and +\texttt{didPrint} environments + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willClose}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{willClose} + !anglemeta(script) +\end{willClose} +\end{dCmd} +\EnvDescription The JS code in the body of the \texttt{willClose} +environment will execute just before the document closes. + +\EnvLoc Place this environment in the preamble. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willSave}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{willSave} + !anglemeta(script) +\end{willSave} +\end{dCmd} +\EnvDescription The JS code in the body of the \texttt{willSave} +environment will execute just before the document is saved. + +\EnvLoc Place this environment in the preamble. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{didSave}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{didSave} + !anglemeta(script) +\end{didSave} +\end{dCmd} +\EnvDescription The JS code in the body of the \texttt{didSave} +environment will execute just after the document is saved. + +\EnvLoc Place this environment in the preamble. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willPrint}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{willPrint} + !anglemeta(script) +\end{willPrint} +\end{dCmd} +\EnvDescription The JS code in the body of the \texttt{willPrint} +environment will execute just before the document is Printed. + +\EnvLoc Place this environment in the preamble. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{didPrint}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{didPrint} + !anglemeta(script) +\end{didPrint} +\end{dCmd} +\EnvDescription The JS code in the body of the \texttt{didPrint} +environment will execute just after the document is Printed. + +\EnvLoc Place this environment in the preamble. + +\paragraph*{\textcolor{red}{Developer Notes:}} +I've inserted five commands, +\settowidth{\aebdimen}{\ttfamily\string\developer@will@Print}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\developer@will@Close +\developer@will@Save +\developer@did@Save +\developer@will@Print +\developer@did@Print +\end{dCmd} +that are let to \cs{@empty}. A package developer can insert JS code to make the package +behave as desired, while the document author can use the above environments to add any +additional scripts. + +The correct way of using these commands is + +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()] +\begin{defineJS}{\my@WillClose} + !anglemeta(some willClose script) +\end{defineJS} +\let\my@save@developer@will@Close\developer@will@Close +\def\developer@will@Close{% + \my@save@developer@will@Close + \my@WillClose +} +\end{Verbatim} +This is the technique I used in the \textsf{acroflex} package. + + +\subsection{Document Open Actions} + +You can set an action to be performed when the document is opened, +independently of the page the document is opened at. + +\settowidth{\aebdimen}{\ttfamily\string\additionalOpenAction\darg{\meta{action}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\additionalOpenAction{!meta(action)} +\end{dCmd} +\CmdDescription The \meta{action} can be any type of action described in the +\emph{PDF Reference}, but it is usually a JavaScript action. + +\CmdLoc Place this command in the preamble. + +The following example gets the time the user first opens the document, +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily\small var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());\}\}}% +\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule} +\additionalOpenAction{\JS{% + var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());}} +\end{dCmd*} +\egroup +\noindent\textcolor{red}{\textbf{Important:}} This open action takes place rather +early in document initialization, before the document level JavaScript is +scanned; therefore, the \meta{action} should not reference any +document level JavaScript, as at the time of the action, they are still +undefined. You are restricted to core JavaScript and the JavaScript API +for \textsf{Acrobat}. + +\newtopic Using layers put a natural restriction on the version that +can be used to effectively view the document. To put a requirement on the +viewer to be used, use the \cs{re\-quires\-Version} command. + +\settowidth{\aebdimen}{\ttfamily\string\requiresVersion[\meta{option}]\darg{\meta{version\_number}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\requiredVersionMsg{!meta(message)} +\alternateDocumentURL{!meta(url)} +\requiredVersionMsgRedirect{!meta(message)} +\afterRequirementPassedJS{!meta(JS code)} +\requiresVersion[!meta(option)]{!meta(version_number)} +\end{dCmd} + +\CmdLoc Place these commands in the preamble. + +\CmdDescription For \cs{requiresVersion}, the parameter +\meta{version\_number} is the minimal version number that this +document is made for. If the version number of the viewer is less +than \meta{version\_number}, an alert box appears, and the +document is silently closed, if outside a browser, or redirected, if +inside a browser. If the keyword \texttt{warnonly} is passed as the +value of the optional parameter, the alert messages will appear, but +the file will not be closed or redirected. + +\newtopic\textcolor{red}{\textbf{Important:}} The command \cs{requiresVersion} +needs to be issued \emph{after} any redefinitions of the +\begin{gather*} +\cs{afterRequirementPassedJS},\ \cs{requiredVersionMsgRedirect},\\ +\cs{requiredVersionMsg}, \text{ and } \cs{alternateDocumentURL} +\end{gather*} + +When the document is opened outside a web browser and the version +number requirement is not met, the message contained in +\cs{requiredVersionMsg} appears in an alert box. The default +definition is +\begin{Verbatim}[xleftmargin=\amtIndent] +\requiredVersionMsg{% + This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later. + The document is now closing.} +\end{Verbatim} +The argument of \cs{requiresVersion} is contained in \cs{requireVersionNumber}, +and this macro should be used in the message, as illustrated above. + +When the document is opened in a browser and the version number requirement is not met +the message contained in \cs{requiredVersionMsgRedirect} appears in an alert box. The +default definition is +\begin{Verbatim}[xleftmargin=\amtIndent] +\requiredVersionMsgRedirect{% + This document requires Adobe Reader or Acrobat, + version \requiredVersionNumber\space or later. + Redirecting browser to an alternate page.} +\end{Verbatim} +The browser is redirected to the URL specified in the argument of +\cs{alternateDoc\-u\-ment\-URL}, the default definition of which is +\begin{Verbatim}[xleftmargin=\amtIndent] +\alternateDocumentURL{http://www.acrotex.net/} +\end{Verbatim} + +\newtopic The command \cs{requiresVersion} uses \cs{additionalOpenAction}; if you want +to combine several actions, including an action for checking for the version number, use +\cs{afterRe\-quire\-ment\-PassedJS}. For example, + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily\small var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());\}\}}% +\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule} +\afterRequirementPassedJS +{% + var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date()); +} +\end{dCmd*} +\egroup\noindent The above code will be executed if the version requirement is passed. + +You can use \cs{afterRequirementPassedJS}, for example, to put deadline to view the document; that is, +if the document is opened after a pre-selected date and time, the document should close +down (or redirected to an alternate web page). + +\newtopic\textcolor{red}{\textbf{Important:}} When using {\AEBP} with the \texttt{uselayers} option, the minimum +required version is 7. Thus, +\begin{Verbatim}[xleftmargin=\amtIndent] +\requiresVersion{7} +\end{Verbatim} +should be issued in the preamble of any document that uses layers. + +\section{Page Actions} + +When a page opens or closes a JavaScript occurs. Predefined +JavaScript can execute in reaction to these events. {\cAEBP} +provides several commands and environments. + +\exPDFSrc{aebpro_ex1} The commands and environments described in +this section are illustrated in the support document +\texttt{aebpro\_ex1}. + +\subsection{Open/Close Page Actions for First Page} + +Because of the way {\AEB} was originally written---\textsf{exerquiz}, +actually---, the first page is a special case. + +There is a command, \cs{OpenAction}, that is part of the +\texttt{insdljs} package for several years, that is used to +introduce open page actions: + +\settowidth{\aebdimen}{\ttfamily\string\OpenAction\darg{\string\JS\darg{\meta{script}}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\OpenAction{\JS{!meta(script)}} +\end{dCmd} + +\CmdLoc This command goes in the preamble to define action for the +first page. This command is capable of defining non-JavaScript +action, see the documentation of \texttt{insdljs} for some details. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily\small console.println("Show the output of the page actions");}% +\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule} +\OpenAction{\JS{% + console.show();\r + console.clear();\r + console.println("Show the output of the page actions"); +}} +\end{dCmd*} +\egroup + +In addition to \cs{OpenAction}, \texttt{addJSToPageOpen} and +\texttt{addJSToPageClose} are also defined by {\cAEBP}. The +\meta{script} is executed each time the page is opened or +closed. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpen}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageOpen} + !anglemeta(script) +\end{addJSToPageOpen} +\end{dCmd} + +For page close events, we have the \texttt{addJSToPageClose} +environment. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageClose}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageClose} + !anglemeta(script) +\end{addJSToPageClose} +\end{dCmd} + +\EnvDescription When placed in the preamble, these provide +JavaScript support for page open/close events of the first page. + +Below are examples of usage. These appear in the document +\texttt{aebpro\_ex1}. +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily\small{console.println(str + ": page " + (this.pageNum+1));}}% +\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageOpen} +var str = "This should be the first page"; +console.println(str + ": page " + (this.pageNum+1)); +\end{addJSToPageOpen} +\end{dCmd*} +\egroup +\noindent and +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily\small{var str = "This is the close action for the first page!";}}% +\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageClose} +var str = "This is the close action for the first page!"; +console.println(str + ": page " + (this.pageNum+1)); +\end{addJSToPageClose} +\end{dCmd*} +\egroup + +\subsection{Open/Close Page Actions for the other Pages}\label{pageactions} + +The same two environments \texttt{addJSToPageOpen} and +\texttt{addJSToPageClose} can be used in the body of the text to +generate open or close actions for the page on which they appear. +It's a rather hit or miss proposition because the tex compiler may +break the page at an unexpected location and the environments are +processed on the page following the one you wanted them to appear +on. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpen}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageOpen} + !anglemeta(script) +\end{addJSToPageOpen} +\end{dCmd} + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageClose}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageClose} + !anglemeta(script) +\end{addJSToPageClose} +\end{dCmd} + +\EnvDescription Place on the page that these actions are to apply. + +\newtopic Another approach to trying to place +\texttt{addJSToPageOpen} or \texttt{addJSTo\-Page\-Close} on the +page you want is to use the \texttt{addJSToPageOpenAt} or +\texttt{addJSToPageCloseAt} environments. These are the same as +their cousins, but are more powerful. Each of these takes an +argument that specifies the page, pages, and/or page ranges of the +open/close effects you want. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpenAt}\darg{\meta{page-ranges}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageOpenAt}{!meta(page-ranges)} + !anglemeta(script) +\end{addJSToPageOpenAt} +\end{dCmd} + +\noindent For page close events, we have the \texttt{addJSToPageClose} +environment. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageCloseAt}\darg{\meta{page-ranges}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageCloseAt}{!meta(page-ranges)} + !anglemeta(script) +\end{addJSToPageCloseAt} +\end{dCmd} + +\removelastskip\EnvLoc Place these just after \verb!\begin{document}! and before the +command \cs{maketitle}. + +%\EnvDescription When placed in the preamble, these provide +%JavaScript support for page open/close events of the first page. + +\PD The two environments take a comma-delimited list of pages and page +ranges, for example, an argument might be \verb!{2-6,9,12,15-}!. +This argument states that the open or close JavaScript listed in the +environment should execute on pages 2 through 6, page 9, page 11, +and pages 15 through the end of the document. Very cool! + +This is all well and good if you know exactly which pages are the +ones you want the effects to appear. What's even more cool is that +you can use {\LaTeX}'s cross-referencing mechanism to specify the +pages. By placing these after \verb!\begin{document}!, +the cross referencing information (the \texttt{.aux}) has been input +and you can use \cs{atPage}, a special simplified version of +\cs{pageref}, to reference the pages. +below. + +\settowidth{\aebdimen}{\ttfamily\string\atPage\darg{\meta{label}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\atPage{!meta(label)} +\end{dCmd} + +\CmdDescription Returns the page number on which the {\LaTeX} +cross-reference label \meta{label} resides. + +For example, + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpenAt}\darg{1,\string\atPage]\darg{test}-\string\atPage\darg{exam}}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageOpenAt}{1,\atPage{test}-\atPage{exam}} +var str = "Add to open page at pages between " + + "\\\\atPage{test} and \\\\atPage{exam} " + + (this.pageNum+1); +console.println(str); +\end{addJSToPageOpenAt} +\end{dCmd*} +In the above, we specify a range \verb!\atPage{test}-\atPage{exam}!. +If the first page number is larger than the second number, the two +numbers are switched; consequently, the specification +\verb!\atPage{exam}-\atPage{test}! yields the same results. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily{var str = "Add to close page at page " + (this.pageNum+1);}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{addJSToPageCloseAt}{5-8,12,15-} +var str = "Add to close page at page " + (this.pageNum+1); +console.println(str); +\end{addJSToPageCloseAt} +\end{dCmd*} +\egroup +In the above example, notice that in the \texttt{addJSToPageOpenAt} +environment above, page 1 was specified. This specification is +ignored. You do remember that the first page events need to be +defined in the preamble, don't you. + +\subsection{Every Page Open/Close Events} + +As an additional feature, there may be an occasion where you want to +define an event for every page. These are handled separately from +the earlier mentioned open/closed events so one does not overwrite +the other. These environments are \texttt{everyPageOpen} and +\texttt{everyPageClose}. They can go in the preamble, or anywhere. +They will take effect on the page they are processed on. Using +these environments a second time overwrites any earlier definition. +To cancel out the every page action you can use +\Com{canceleveryPageOpen} and \Com{canceleveryPageClose}. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{everyPageOpen}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{everyPageOpen} + !anglemeta(script) +\end{everyPageOpen} +\end{dCmd} + +For page close events, we have the \texttt{everyPageClose} environment. + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{everyPageClose}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{everyPageClose} + !anglemeta(script) +\end{everyPageClose} +\end{dCmd} + +\EnvLoc Place in the preamble or in the body of the document. + +For example, + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily{console.println(str + ": page " + (this.pageNum+1));}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\begin{everyPageOpen} +var str = "every page open"; +console.println(str + ": page " + (this.pageNum+1)); +\end{everyPageOpen} +\end{dCmd*} +\egroup + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily{console.println(str + ": page " + (this.pageNum+1));}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\begin{everyPageClose} +var str = "every page close"; +console.println(str + ": page " + (this.pageNum+1)); +\end{everyPageClose} +\end{dCmd*} +\egroup + + +\settowidth{\aebdimen}{\ttfamily\string\canceleveryPageClose}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\canceleveryPageOpen +\canceleveryPageClose +\end{dCmd} + +\CmdDescription These two commands cancel the current \env{everyPageOpen} and +\env{everyPageClose} events. Following the cancel commands, use +the \env{everyPageOpen} or \env{everyPageClose} environment to create +different every page events. + + +\section{Fullscreen Support}\label{FSSupport} + + +In this section we present the controlling commands for default +fullscreen mode and for defining page transition effects. + +\exPDFSrc{aebpro_ex1} The sample file \texttt{aebpro\_ex1} +demonstrates many of the full screen features described in this +section. + + +\subsection{Set Fullscreen Defaults: + \texorpdfstring{\protect\cs{setDefaultFS}}{\textbackslash setDefaultFS}} + +Set the default fullscreen behavior of \textsf{Adobe +Reader}/\textsf{Acrobat} by using \cs{setDefaultFS} in the preamble. This +command takes a number of arguments using the \texttt{xkeyval} package. +Each key corresponds to a JavaScript property of the \texttt{Fullscreen} +object. + +\settowidth{\aebdimen}{\ttfamily\string\setDefaultFS\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setDefaultFS{!meta(KV-pairs)} +\end{dCmd} +The command for setting how you want to viewer to behave in fullscreen. +This command is implemented through JavaScript, as opposed to the +\textbf{pdfmark} operator. See \emph{JavaScript for Acrobat API Reference} +\cite{tech:AcroJSRef}, the section on the \texttt{FullScreen} object. + +\CmdLoc This command must be executed in the preamble. + +\KVP The command has numerous key-value pairs, the defaults of most +of these are set in the \texttt{Preferences} menu of the viewer. +These values are the ones listed in the \emph{Acrobat JavaScript +Scripting Reference} \cite{tech:AcroJSRef}. +\begin{enumerate}\raggedright + \item \texttt{Trans}: permissible values are + \texttt{NoTransition}, \texttt{UncoverLeft}, + \texttt{UncoverRight}, \texttt{UncoverDown}, \texttt{UncoverUp}, + \texttt{UncoverLeftDown}, \texttt{UncoverLeftUp}, + \texttt{UncoverRightDown}, \texttt{UncoverRightUp}, + \texttt{CoverLeft}, \texttt{CoverRight}, \texttt{CoverDown}, + \texttt{CoverUp}, \texttt{CoverLeftDown}, \texttt{CoverLeftUp}, + \texttt{CoverRightDown}, \texttt{CoverRightUp}, + \texttt{PushLeft}, \texttt{PushRight}, \texttt{PushDown}, + \texttt{PushUp}, \texttt{PushLeftDown}, \texttt{PushLeftUp}, + \texttt{PushRightDown}, \texttt{PushRightUp}, + \texttt{FlyInRight}, \texttt{FlyInLeft}, \texttt{FlyInDown}, + \texttt{FlyInUp}, \texttt{FlyOutRight}, \texttt{FlyOutLeft}, + \texttt{FlyOutDown}, \texttt{FlyOutUp}, \texttt{FlyIn}, + \texttt{FlyOut}, \texttt{Blend}, \texttt{Fade}, \texttt{Random}, + \texttt{Dissolve}, \texttt{GlitterRight}, \texttt{GlitterDown}, + \texttt{GlitterRightDown}, \texttt{BoxIn}, \texttt{BoxOut}, + \texttt{BlindsHorizontal}, \texttt{BlindsVertical}, + \texttt{SplitHorizontalIn}, \texttt{SplitHorizontalOut}, + \texttt{SplitVerticalIn}, \texttt{SplitVerticalOut}, + \texttt{WipeLeft}, \texttt{WipeRight}, \texttt{WipeDown}, + \texttt{WipeUp}, \texttt{WipeLeftDown}, \texttt{WipeLeftUp}, + \texttt{WipeRightDown}, \texttt{WipeRightUp}, \texttt{Replace}, + \texttt{ZoomInDown}, \texttt{ZoomInLeft}, + \texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp}, + \texttt{ZoomInRight}, \texttt{ZoomInRightDown}, + \texttt{ZoomInRightUp}, \texttt{ZoomInUp}, \texttt{ZoomOutDown}, + \texttt{ZoomOutLeft}, \texttt{ZoomOutLeftDown}, + \texttt{ZoomOutLeftUp}, \texttt{ZoomOutRight}, + \texttt{ZoomOutRightDown}, \texttt{ZoomOutRightUp}, + \texttt{ZoomOutUp}, \texttt{CombHorizontal}, + \texttt{CombVertical}. The default is \texttt{Replace}. + + \item[] The following are new to \textsf{Acrobat}/\textsf{Adobe + Reader} version 8: \texttt{PushLeftDown}, \texttt{PushLeftUp}, + \texttt{PushRightDown}, \texttt{PushRightUp}, + \texttt{WipeLeftDown}, \texttt{WipeLeftUp}, + \texttt{WipeRightDown}, \texttt{WipeRightUp}, + \texttt{ZoomInDown}, \texttt{ZoomInLeft}, + \texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp}, + \texttt{ZoomInRight}, \texttt{ZoomInRightDown}, + \texttt{ZoomInRightUp}, \texttt{ZoomInUp}, + \texttt{ZoomOutDown}, \texttt{ZoomOutLeft}, + \texttt{ZoomOutLeftDown}, \texttt{ZoomOutLeftUp}, + \texttt{ZoomOutRight}, \texttt{ZoomOutRightDown}, + \texttt{ZoomOutRightUp}, \texttt{ZoomOutUp}, + \texttt{CombHorizontal}, \texttt{CombVertical} + + +\rightskip=0pt +\item[] The transition chosen by this key will be in effect for each page that does not +have a transition effect separately defined for it (by the \Com{setPageTransition} command). + +\item \texttt{bgColor}: Sets the background color in fullscreen mode. + The color specified must be a JavaScript Color array, e.g., + \verb!bgColor={["RGB",0,1,0]}!, or you can use some preset colors, + \verb!bgColor = color.ltGray!. +\item \texttt{timeDelay}: The default number of seconds before the + page automatically advances in full screen mode. See + \texttt{useTimer} to activate/deactivate automatic page turning. +\item \texttt{useTimer}: A Boolean that determines whether automatic + page turning is enabled in full screen mode. Use \texttt{timeDelay} to set + the default time interval before proceeding to the next page. +\item \texttt{loop}: A Boolean that determines whether the document will loop around back + to the first page. +\item \texttt{cursor}: Determines the behavior of the mouse in full screen mode. Permissible + values are \texttt{hidden}, \texttt{delay} (hidden after a short delay) and \texttt{visible}. +\item \texttt{escape}: A Boolean use to determine if the escape key will cause the viewer + to leave full screen mode. +\item \texttt{clickAdv}: A Boolean that determines whether a mouse click on the page will + cause the page to advance. +\item \texttt{fullscreen}: A Boolean, which if \texttt{true}, causes the viewer to go into + full screen mode. Has no effect from within a browser. +\item \texttt{usePageTiming}: A Boolean that determines whether + automatic page turning will respect the values specified for + individual pages in full screen mode (which can be set through + \Com{setPageTransition}). + +\end{enumerate} + +This example causes the viewer to go into full screen mode, +sets the transition to \texttt{Random}, instructs the viewer to loop +back around to the first page, and to make the cursor hidden after a +short period of inactivity. +\settowidth{\aebdimen}{\ttfamily\string\setDefaultFS\darg{fullscreen,Trans=Random,loop,cursor=delay,escape}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setDefaultFS{fullscreen,Trans=Random,loop,cursor=delay,escape} +\end{dCmd*} + +On closing the document, the user's original full screen preferences +are restored. + +\newtopic In the preamble of this document, I have placed +\cs{setDefaultFS} specifying that the document should go into +fullscreen mode with a random transition for its default transition +effect. + + +\subsection{Page Transition Effects} + +The \Com{setDefaultFS} command can set the full screen behavior of +the viewer for the \emph{entire document}, including a transition +effect applicable to all pages in the document; for transition +effects of individual pages, use the \cs{setPageTransition} command. + +\settowidth{\aebdimen}{\ttfamily\string\setPageTransition\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setPageTransition{!meta(KV-pairs)} +\end{dCmd} +Sets the transition effect for the \emph{next page only}, viewer must be +in full screen mode. The command \cs{setPageTransition} is implemented +using the \textbf{pdfmark} operator. + +\CmdLoc This command should be used in the preamble for the first page, +and between slides for subsequent pages. + +\KVP The \Com{setPageTransition} command has several key-value pairs: +\begin{enumerate}\raggedright + \item \texttt{Trans}: permissible values are + \texttt{NoTransition}, \texttt{UncoverLeft}, + \texttt{UncoverRight}, \texttt{UncoverDown}, \texttt{UncoverUp}, + \texttt{UncoverLeftDown}, \texttt{UncoverLeftUp}, + \texttt{UncoverRightDown}, \texttt{UncoverRightUp}, + \texttt{CoverLeft}, \texttt{CoverRight}, \texttt{CoverDown}, + \texttt{CoverUp}, \texttt{CoverLeftDown}, \texttt{CoverLeftUp}, + \texttt{CoverRightDown}, \texttt{CoverRightUp}, + \texttt{PushLeft}, \texttt{PushRight}, \texttt{PushDown}, + \texttt{PushUp}, \texttt{PushLeftDown}, \texttt{PushLeftUp}, + \texttt{PushRightDown}, \texttt{PushRightUp}, + \texttt{FlyInRight}, \texttt{FlyInLeft}, \texttt{FlyInDown}, + \texttt{FlyInUp}, \texttt{FlyOutRight}, \texttt{FlyOutLeft}, + \texttt{FlyOutDown}, \texttt{FlyOutUp}, \texttt{FlyIn}, + \texttt{FlyOut}, \texttt{Blend}, \texttt{Fade}, \texttt{Random}, + \texttt{Dissolve}, \texttt{GlitterRight}, \texttt{GlitterDown}, + \texttt{GlitterRightDown}, \texttt{BoxIn}, \texttt{BoxOut}, + \texttt{BlindsHorizontal}, \texttt{BlindsVertical}, + \texttt{SplitHorizontalIn}, \texttt{SplitHorizontalOut}, + \texttt{SplitVerticalIn}, \texttt{SplitVerticalOut}, + \texttt{WipeLeft}, \texttt{WipeRight}, \texttt{WipeDown}, + \texttt{WipeUp}, \texttt{WipeLeftDown}, \texttt{WipeLeftUp}, + \texttt{WipeRightDown}, \texttt{WipeRightUp}, \texttt{Replace}, + \texttt{ZoomInDown}, \texttt{ZoomInLeft}, + \texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp}, + \texttt{ZoomInRight}, \texttt{ZoomInRightDown}, + \texttt{ZoomInRightUp}, \texttt{ZoomInUp}, \texttt{ZoomOutDown}, + \texttt{ZoomOutLeft}, \texttt{ZoomOutLeftDown}, + \texttt{ZoomOutLeftUp}, \texttt{ZoomOutRight}, + \texttt{ZoomOutRightDown}, \texttt{ZoomOutRightUp}, + \texttt{ZoomOutUp}, \texttt{CombHorizontal}, + \texttt{CombVertical}. The default is \texttt{Replace}. + + \item[] The following are new to \textsf{Acrobat}/\textsf{Adobe + Reader}, version 8: \texttt{PushLeftDown}, + \texttt{PushLeftUp}, \texttt{PushRightDown}, + \texttt{PushRightUp}, \texttt{WipeLeftDown}, + \texttt{WipeLeftUp}, \texttt{WipeRightDown}, + \texttt{WipeRightUp}, \texttt{ZoomInDown}, + \texttt{ZoomInLeft}, \texttt{ZoomInLeftDown}, + \texttt{ZoomInLeftUp}, \texttt{ZoomInRight}, + \texttt{ZoomInRightDown}, \texttt{ZoomInRightUp}, + \texttt{ZoomInUp}, \texttt{ZoomOutDown}, \texttt{ZoomOutLeft}, + \texttt{ZoomOutLeftDown}, \texttt{ZoomOutLeftUp}, + \texttt{ZoomOutRight}, \texttt{ZoomOutRightDown}, + \texttt{ZoomOutRightUp}, \texttt{ZoomOutUp}, + \texttt{CombHorizontal}, \texttt{CombVertical} + + +\rightskip=0pt +\item[] These values are the ones listed in the \emph{Acrobat + JavaScript Scripting Reference} \cite{tech:AcroJSRef}. + \item \texttt{TransDur}: Duration of the transition effect, in + seconds. Default value: 1. + + \item \texttt{Speed}: Same as \texttt{TransDur}, the duration of + the transition effect, except this key takes values + \texttt{Slow}, \texttt{Medium} or \texttt{Fast}, corresponding + to the \textsf{Acrobat} UI. If \texttt{TransDur} and + \texttt{Speed} are both specified, Speed is used. Use + \texttt{TransDur} for finer granularity. + + \item \texttt{PageDur}: The \emph{PDF Reference, version 1.6} + \cite{tech:PDFRef}, describes this as ``The page's display + duration (also called its advance timing): the maximum + length of time, in seconds, that the page is displayed + during presentations before the viewer application + automatically advances to the next page. By default, the + viewer does not advance automatically.'' +\end{enumerate} +For example, +\settowidth{\aebdimen}{\ttfamily\string\setPageTransition\darg{Trans=Blend,PageDur=20,TransDur=5}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setPageTransition{Trans=Blend,PageDur=20,TransDur=5} +\end{dCmd*} + + +\cs{setPageTransition} suffers from the same malady as +do \texttt{addJSToPage\-Open} and \texttt{addJSToPageClose}, it has +to be placed on the page you want to apply. For this reason, there +is the \cs{setPageTransitionAt}. + +\settowidth{\aebdimen}{\ttfamily\string\setPageTransitionAt\darg{\meta{page-ranges}}\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setPageTransitionAt{!meta(page-ranges)}{!meta(KV-pairs)} +\end{dCmd} + +\KVP Same as \cs{setPageTransitionAt} + +\PD The parameter \meta{page-ranges} has the same format as +described in \hyperref[pageactions]{Section~\ref*{pageactions}}, +page~\pageref*{pageactions}. This command obeys the \cs{atPage}. + +For example, +\settowidth{\aebdimen}{\ttfamily\string\setPageTransitionAt\darg{1,\string\atPage\darg{test}-\string\atPage\darg{exam},7}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\setPageTransitionAt{1,\atPage{test}-\atPage{exam},7} + {Trans=Blend,PageDur=20,TransDur=5} +\end{dCmd*} + + +\section{Attaching Documents} + +{\cAEBP} has two options for attaching files to the source PDF. The +approach is the \texttt{import\-Data\-Object} JavaScript method in +conjunction with the FDF techniques. + +There are two options for attaching files +\begin{enumerate} + \item \texttt{attachsource} is a simplified option for attaching + a file with the same base name as \cs{jobname}, that is a file + of the form \cs{jobname.}\texttt{\textsl{ext}}. + + \item \texttt{attachments} is a general option for attaching a + file, as specified by its absolute or relative path. +\end{enumerate} + +\exPDFSrc{aebpro_ex3} The file \texttt{aebpro\_ex3} demonstrates many +of the commands presented in this section. + +\subsection{The \texttt{attachsource} option}\label{attachsource} + +Use this option to attach a file with the same base name as \cs{jobname}. +\begin{Verbatim}[xleftmargin=\amtIndent] +\usepackage[% + driver=dvips, + web={ + pro, + ... + usesf + }, + attachsource={tex,dvi,log,tex.log}, + ... +]{aeb_pro} +\end{Verbatim} +Simply list the extensions you wish to attach to the current document. In +the example above, we attach the original source file \cs{jobname.tex}, +\cs{jobname.dvi}, \cs{jobname.log} (the \textsf{Distiller} log) and +\cs{jobname.tex.log} (the tex log). + +\newtopic One problem with attaching the log file is that the \textsf{Distiller} also +produces a log file with the same name \cs{jobname.log}. Consequently, the +log file for the tex file is overwritten by the \textsf{Distiller} log +file. You'll see from the PDF document, that the log file attached is the +one for the \textsf{Distiller}. + +\newtopic A work around for this is to latex your file, rename the +log file to another extension, such as \cs{jobname.tex.log}, then +distill. You may want to send that log file so some poor \TeX pert for +\TeX pert analysis! + +\subsection{The \texttt{attachments} option}\label{attachments} + +The \texttt{attachments} key is for attaching files other than ones +associated with the source file. The value of this key is a +comma-delimited list (enclosed in braces) of absolute paths and/or +relative paths to the file required to attach. For example, +\begin{Verbatim}[xleftmargin=\amtIndent] +\usepackage[% + driver=dvips, + web={ + pro, + ... + usesf + }, + attachments={robot man/robot_man.pdf,% + /C/Documents and Settings/dps/My Documents/birthday17.jpg}, + ... +]{aeb_pro} +\end{Verbatim} +The first reference is relative to the folder that this source file +is contained in (and is attached to this PDF), and second one is an +example of an absolute path. + +\Important There are some files that \textsf{Acrobat} does not attach, but +there is no public list of these. One finds them by discovery, +\texttt{.exe} and \texttt{.zip} files, for example. + +A trick that I use to send \texttt{.zip} files through the email (they are +often stripped away by mail servers) is to \emph{hide} the \texttt{.zip} +file in a PDF as an attachment. But since \textsf{Acrobat} does not attach +\texttt{.zip}, I change the extension from \texttt{.zip} to \texttt{.txt}, +then inform the recipient to save the \texttt{.txt} file and change the +extension back to \texttt{.zip}. Swave! + +\subsection{Optional attachments} + +The \texttt{attachments} options allows you to list a collection of files +to be attached to the PDF file. The optional attachments concept allows +you to develop a list of attachments that are attached if the +\texttt{optattachments} option is taken and not attached if the +\texttt{!optattachments} option is taken. {\AEBP} defines +\cs{ifoptattachments}, a Boolean switch, which is set to true by +\texttt{optattachments} and to false by \texttt{!optattachments}. +\settowidth{\aebdimen}{\ttfamily\string\addtoOptAttachments\darg{\meta{list\_of\_files}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\addtoOptAttachments{!meta(list_of_files)} +\end{dCmd} +This command can be used anywhere in the document and adds the listed +files to the ones to be attached. The list is comma delimited. + +The initial application and motivation of this feature is for projects +that are worked on by a team of {\LaTeX} authors. The master project file +inputs sections of the document using the \cs{input} command of {\LaTeX}. +The request was for any file that is input using \cs{input} be added to +the optional attachments list; therefore, the {\AEBP} package defines the +following two commands: +\settowidth{\aebdimen}{\ttfamily\string\prjinclude\darg{\meta{file}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\prjinput{!meta(file)} +\prjinclude{!meta(file)} +\end{dCmd} +These are the ``project'' version of the {\LaTeX} commands \cs{input} and +\cs{include}, respectively. Each of these adds \meta{file} to the list +of optional attachments, then passes the argument to the two user commands +\cs{prjInputUser} and \cs{prjIncludeUser}, respectively. +\settowidth{\aebdimen}{\ttfamily\string\newcommand\darg{\string\prjIncludeUser}[1]\darg{\string\include\darg{\#1}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\newcommand{\prjInputUser}[1]{\input{#1}} +\newcommand{\prjIncludeUser}[1]{\include{#1}} +\end{dCmd} +Above you see the default definitions of these user commands. They may be +redefined as desired to achieve some special effect. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \string\marginpar\darg{\string\fbox\darg{\string\footnotesize\string\ttfamily\#1}}}% +\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\renewcommand{\prjInputUser}[1]{% + \marginpar{\fbox{\footnotesize\ttfamily#1}} + \input{#1}} +\end{dCmd*} +\egroup +It is possible to define \cs{prjInputUser} to be a link or button that +opens the attached file. + +When the \texttt{!optattachments} is taken, the default definitions of the +two commands \cs{prjinput} and \cs{prjinclude} are \cs{prjInputUser} and +\cs{prjIncludeUser}, respectively; this bypasses the step of adding the file +to the list of optional attachments. The switch \cs{ifoptattachments} can be +used, as needed, in a custom definition of \cs{prjInputUser} or +\cs{prjIncludeUser}; for example, +\bgroup\obeyspaces% +\settowidth{\aebdimen}{ \ttfamily\string\marginpar% +\darg{\string\fbox\darg{\string\footnotesize\string\ttfamily\string\ifoptattachments}}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\renewcommand{\prjInputUser}[1]{% + \marginpar{\fbox{\footnotesize\ttfamily\ifoptattachments + \setLink[\A{\JS{this.exportDataObject({% + cName: "\getcNameFromFileName{#1}",nLaunch: 0});}} + ]{\textcolor{\ahrefcolor}{#1}}\else#1\fi}}\input{#1}} +\end{dCmd*} +\egroup This code creates a link that saves the attachment, if +\texttt{optattachments} is taken, and simply puts the file name the margin, +if \texttt{!optattachments} is taken. The JavaScript method +\texttt{this.exportDataObject} is used to extract and save the attachment; +the command \cs{getcNameFromFileName} is an {\AEBP} command that associates +the file name (\texttt{\#1}) with the attachment label name (the +\texttt{cName} key). + + +\section{Doc Assembly Methods}\label{docassembly} + +Ahhhh, document assembly. What can be said? This is a method that I +have used for many years and is incorporated into the +\textsf{insdljs} package under the name of \texttt{execJS}. Whereas +the \texttt{execJS} environment is still available to you, I've +simplified things. The term doc assembly refers to the use of the +\texttt{docassembly} environment (which is just an \texttt{execJS} +environment). + +\settowidth{\aebdimen}{\ttfamily\string\begin\darg{docassembly}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{docassembly} + !anglemeta(script) +\end{docassembly} +\end{dCmd} +\noindent +The \texttt{execJS}/\texttt{docassembly} environments create an FDF file +with the various JavaScript commands that were contained in the body of +the environment. These environments also place in open page action so that +when the PDF is opened for the first time in \textsf{Acrobat Pro}, the FDF +file will be imported and the \anglemeta{script} is \emph{executed one time and then +discarded}, see \cite{TUG:execJS} for an article on this topic. This +technique only works if you have \textsf{Acrobat Pro}. + +\subsection{Certain Security Restricted JS Methods} + +In addition to the \texttt{docassembly} environment, {\cAEBP} also +has several macros that expand to JavaScript methods that I find +useful. These JavaScript methods are quite useful, yet they have a \emph{security +restriction} on them; they cannot be executed from within a document, and certainly +not by Adobe Reader. + +The use of these methods requires the installation of +\texttt{aeb\_pro.js}, the folder level JavaScript file that comes +with this package. These methods are normally called from the +\texttt{docassembly} environment. + +\settowidth{\aebdimen}{\ttfamily\string\addWatermarkFromFile(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\addWatermarkFromFile({!meta@KV-pairs~}); +\end{dCmd} +\CmdDescription Inserts a watermark into the PDF + +\KVP Numerous, see the \texttt{addWatermarkFromFile()} method +\cite{tech:AcroJSRef}. Here, we mention only two. +\begin{enumerate} + \item \texttt{cDIPath}: The absolute path to the background or watermark document. + \item \texttt{bOnTop}: (optional) A Boolean value specifying the + z-ordering of the watermark. If \texttt{true} (the default), the watermark + is added above all other page content. If \texttt{false}, the watermark is + added below all other page content. +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\importIcon(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\importIcon({!meta@KV-pairs~}); +\end{dCmd} +\CmdDescription Imports icon files\footnote{The AcroMemory package uses these + environments and functions to import icons.} + +\KVP There are three key-value pairs: +\begin{enumerate} + \item \texttt{cName}: The name to associate with the icon + \item \texttt{cDIPath}: The path to the icon file, it may be absolute or relative + \item \texttt{nPage}: The 0-based index of the page in the PDF file to import as an icon. The + default is 0. +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\importSound(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\importSound({!meta@KV-pairs~}); +\end{dCmd} +\CmdDescription Imports a sound file + +\KVP There are two key-value pairs: +\begin{enumerate} + \item \texttt{cName}: The name to associate with the sound object + \item \texttt{cDIPath}: The path to the sound file, it may be absolute or relative +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\appopenDoc(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\appopenDoc({!meta@KV-pairs~}); +\end{dCmd} +\CmdDescription Opens a document + +\KVP Here, we list only two of five + +\begin{enumerate} + \item \texttt{cPath}: A device-independent path to the document to be opened. If \texttt{oDoc} is specified, the + path can be relative to it. The target document must be accessible in the default file + system. + \item \texttt{oDoc}: (optional) A \texttt{Doc} object to use as a base to resolve a relative cPath. Must be + accessible in the default file system. +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\insertPages(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\insertPages({!meta@KV-pairs~}); +\end{dCmd} +\CmdDescription Inserts pages into the PDF, useful for +inserting pages of difference sizes, such as tables or figures, +into a {\LaTeX} document which requires that all page be of a +fixed size. + +\KVP There are five key-value pairs: +\begin{enumerate} + \item \texttt{nPage}: (optional) The 0-based index of the page after which to insert the source document + pages. Use -1 to insert pages before the first page of the document. + \item \texttt{cPath}: The device-independent path to the PDF file that will provide the inserted pages. The + path may be relative to the location of the current document. + \item \texttt{nStart}: (optional) A 0-based index that defines the start of an inclusive range of pages in the + source document to insert. If only \texttt{nStart} is specified, the range of pages is the single page specified by nStart. + \item \texttt{nEnd}: (optional) A 0-based index that defines the end of an inclusive range of pages in the + source document to insert. If only \texttt{nEnd} is specified, the range of pages is 0 to \texttt{nEnd}. +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\importDataObject(\darg{\meta{KV-pairs}});}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\importDataObject({!meta@KV-pairs~}); +\end{dCmd} + +\CmdDescription Attaches a file to the PDF. This function is used in the two +attachments options of {\cAEBP}. + +\KVP There are two key-value pairs of interest: +\begin{enumerate} + \item \texttt{cName}: The name to associate with the data object. + \item \texttt{cDIPath}: (optional) A device-independent path to a data file on the user’s hard drive. This path may be absolute or relative to the current document. If not + specified, the user is prompted to locate a data file. +\end{enumerate} + +\settowidth{\aebdimen}{\ttfamily\string\executeSave();}% +\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule} +\executeSave(); +\end{dCmd} + +\CmdDescription As you know, you must always save your document +after it is distilled, this saves document JavaScripts in the +document. This command saves the current file so you don't have do +it yourself. This command should be the last one listed in the +\texttt{docassembly} environment.\footnote{Later commands may dirty the document again, and +I have found that saving the document can cause later commands, like \cs{addWatermarkFromFile}, +not to execute.} + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily reason: "I am approving this document",}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\sigInfo{ + cSigFieldName: "mySig", + ohandler: security.PPKLiteHandler, + cert: "D_P_Story.pfx", + password: "dps017", + oInfo: { + location: "Niceville, FL", + reason: "I am approving this document", + contactInfo: "dpstory@acrotex.net", + appearance: "My Signature" + } +}; +\signatureSign +\end{dCmd*} +\egroup + +\CmdDescription The \textsf{eforms} package supports the creation of +signature fields. Such fields can be signed using the \textsf{Acrobat} UI, +or programmatically using the \cs{sigInfo} and \cs{signatureSign} +commands. See the eforms manual, \texttt{eformman.pdf} for a detailed +description of the parameters of \cs{sigInfo}. + +\settowidth{\aebdimen}{\ttfamily\string\signatureSetSeedValue(oSeedValue)}% +\begin{dCmd}{\aebdimen+2\fboxsep+2\fboxrule} +\signatureSetSeedValue(oSeedValue) +\end{dCmd} + +\CmdDescription The \textsf{Acrobat} JavaScript methods +\texttt{\emph{Field}.signature\-Set\-Seed\-Value} is implemented through +the {\LaTeX} comment \cs{signature\-Set\-Seed\-Value}. The method needs +the field object of the signature field, this is passed to +\cs{signature\-Set\-Seed\-Value} through the JavaScript variable +\texttt{oSigFileName}. To use this command, you first get +\texttt{oSigFileName}, like so, +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily reasons: ["This is a reason","This is a better reason"],}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +var sv={ + mdp: "defaultAndComments" + reasons: ["This is a reason","This is a better reason"], + flags: 8 +}; +var oSigFileName=this.getField("sigOfDPS"); +\signatureSetSeedValue(sv); +\end{dCmd*} +\egroup The above code defines a object, \texttt{sv}, with seed value +properties: the implication of the \texttt{mp} entry, is that the +signature field is now a certification signature, filling in form +fields and making comments do not invalidate the signature; when the +user signs the document, he must choose from the two listed reasons, +and none other; the \texttt{flags} property makes the choice of a +reason a requirement. The next line, following the definition of +\texttt{sv}, we get the field object of the signature field, and +name it \texttt{oSigFileName}, this is the name that +\cs{signatureSetSeedValue} uses. Finally, we pass the \texttt{sv} +object to \cs{signatureSetSeedValue}. + +Additional information on signatures can be found +at the \mlhref{http://www.adobe.com/go/acrobat_developer}{Acrobat Developer Center}.\footnote{\url{http://www.adobe.com/go/acrobat_developer}} +The \emph{JavaScript for Acrobat API Reference} \cite{tech:AcroJSRef} for details +on these methods and their parameters. + +\subsection{Examples} + +\Ex{} Demonstrate \cs{addWatermarkFromFile}: The following code places a +background graphic on every page the document. This is the kind of code +that is executed for this document. +\bgroup\small\obeyspaces% +\settowidth{\aebdimen}{\small\ttfamily cDIPath: "/C/AcroPackages/ManualBGs/Manual\_BG\_DesignV\_AeB.pdf"}% +\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{docassembly} +\addWatermarkFromFile({ + bOnTop:false, + cDIPath: "/C/AcroPackages/ManualBGs/Manual_BG_DesignV_AeB.pdf" +}); +\end{docassembly} +\end{dCmd*} +\egroup + +\Important It is \emph{very important} to note that the arguments for this +(pseudo-JS method) are enclosed in matching parentheses/braces +combination, i.e., \verb!({!$\dots$\verb!})!. The arguments are +key-value pairs separated by a colon, and the parameters themselves +are separated by commas. (The argument is actually an +object-literal). It is \emph{extremely important} to have the left +parenthesis/brace pair, \verb!({!, immediately follow the function +name. This is because the environment is a partial-verbatim +environment: \verb!\! is still the escape, but left and right braces +have been ``sanitized''. The commands, like +\cs{addWatermarkFromFile} first gobble up the next two tokens, and +re-inserts \verb!({! in a different location. (See the +\textsf{aeb\_pro.dtx} for the definitions.) + +\Ex{} Demonstrate \cs{getSound}: For another cheesy demonstration, +let's import a sound, associate it with a button. I leave it to you +to press the button at your discretion. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\setbox0=\hbox{\includegraphics[height=16bp]{../extras/{\AEB}_Logo.eps}} +\pushButton[\S{S}\W{0}\A{\JS{% + var s = this.getSound("StarTrek");\r + s.play(); +}}]{cheesySound}{\the\wd0 }{\the\ht0 } +\end{Verbatim} +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{docassembly} +try { + \importSound({cName: "StarTrek", cDIPath: "../extras/trek.wav" }); +} catch(e) { console.println(e.toString()) }; +\end{docassembly} +\end{Verbatim} +\exPDFSrc{aebpro_ex3} The working version of this appears in +\texttt{aebpro\_ex3}. + +\Ex{} Demonstrate \cs{getIcon}: Import a few {\AEB} logos +(forgive me) and place them as appearance faces for a button. +Below is a listing of the code, with some comments added. +\begin{Verbatim}[fontsize=\footnotesize] +\begin{docassembly} +// Import the sounds into the document +\importIcon({cName: "logo",cDIPath: "../extras/{\AEB}_Logo.pdf"}); +\importIcon({cName: "logopush",cDIPath: "../extras/{\AEB}_Logo_bw15.pdf"}); +\importIcon({cName: "logorollover",cDIPath: "../extras/{\AEB}_Logo_bw50.pdf"}); +var f = this.getField("cheesySound"); // get the field object of the button +f.buttonPosition = position.iconOnly; // set it to receive icon appearances +var oIcon = this.getIcon("logo"); // get the "logo" icon +f.buttonSetIcon(oIcon,0); // assign it as the default appearance +oIcon = this.getIcon("logopush"); // get the "logopush" icon +f.buttonSetIcon(oIcon,1); // assign it as the down appearance +oIcon = this.getIcon("logorollover"); // get the "logorollover" icon +f.buttonSetIcon(oIcon,2); // assign it as the rollover appearance +\end{docassembly} +\end{Verbatim} + +\exPDFSrc{aebpro_ex3} The working version of this appears in \texttt{aebpro\_ex3}. + +\Ex{}\label{importdataobject} Demonstrate \cs{importDataObject}: As a final example of +\texttt{docassembly} usage, rather than using the attachments +options of {\cAEBP}, you can also attach your own files using the +\texttt{docassembly} environment. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{docassembly} +try { + \importDataObject({ + cName: "AeB Pro Example #2", + cDIPath: "aebpro_ex2.pdf" + }); +} catch(e){} +\end{docassembly} +\end{Verbatim} +The attachments options automatically assign names. These names appear in +the Description column of the attachments tab of +\textsf{Acrobat}/\textsf{Reader}. For file attached using the +\texttt{attachsource}, the base name plus extension is used, for the files +specified by the \texttt{attachments} key, the names are given +sequentially, \texttt{"{\AEB} Attachment 1"}, \texttt{"{\AEB} Attachment 2"} and +so on. When you roll your own, the description can be more aptly chosen. +On the other hand, there are commands, introduced later, that allow you to +change the default description, to one of your own choosing. + +I have found many uses for the \texttt{execJS} environment, or the +simplified \texttt{docassembly} environment. You are only limited by your +imagination, and knowledge of JavaScript for \textsf{Acrobat}. + +\subsection{Pre-\texttt{docassembly} Methods} + +In this section, we'll gather some ``useful'' commands that may be useful +in combining several \texttt{docassembly} tasks together. The +\texttt{docassembly} environment is a partial-verbatim environment, +expansion is severely limited. The trick is to expand before placing the +lines in the \texttt{docassembly} environment. + +\subsubsection{Importing and Placing Images} + +In this section we introduce four commands for importing images +(possibly with various graphic formats) into the PDF document, and +inserting them as images that appear in the document itself. These are\\[3pt] +\hspace*{20pt}\Com{declareImageAndPlacement}, \Com{declareMultiImages},\\ +\hspace*{20pt}\Com{insertPreDocAssembly}, and \Com{placeImage}. + +\exAeBBlogPDF{p=315} The file \texttt{placeimages.pdf} is a +demo of the commands of this section. The source file and images are +attached to the PDF. The PDF, titled \textsl{Importing and Placing +Images using {\AEBP}}, is found at the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site. + +\settowidth{\aebdimen}{\ttfamily\string\declareImageAndPlacement\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\declareImageAndPlacement{!meta(KV-pairs)} +\end{dCmd} +\CmdDescription This command creates the JavaScript code to import images +(icons) and associates them with target push buttons that are created by +\cs{placeImage}. The images are imported into the document when the +document is first opened in \textsf{Acrobat}. The images themselves can be +PDF, BMP, GIF, JPEG, PCX, PNG, TIFF, or some other supported format. (See +the documentation on the method \texttt{\emph{Doc}.importIcon} for +details.) The file is converted to PDF when imported. + +\Important This command is executed in the preamble only, can be executed +more than once, (once for each image being imported), and \emph{outside of +the \texttt{docassembly} environment}. + +\KVP This command takes up to four key-value pairs. +\begin{itemize} + \item \texttt{name}: (\emph{Optional}) The symbolic name to be associated with this image. The name + is later used to attach the image to the push button (created by \cs{placeImage}). + If a value for this key is not provided, one will be automatically created. + \item \texttt{path}: (\emph{Required}) The path to the image, this can be a relative path or an absolute + path. If absolute, use the device independent path notation of \textsf{Acrobat}; for example,\\[3pt] + \hspace*{20pt}\texttt{/C/acrotex/myimages/myimage.png}. + \item \texttt{page}: (\emph{Optional}) If the image is a PDF, the PDF may contain several pages, + each with an image on it. You can specify which of the pages to import using + the \texttt{page} key. If no \texttt{page} key is specified, page 0 is assumed. + \item\texttt{placement}: (\emph{Optional}) This is a comma-delimited list of names of push buttons + created by the command \cs{placeImage}. Multiple place images with the same name all get the + image imported into it. If you want several place images with different names, + list these in a comma delimited list, like so +\begin{Verbatim} + placement={image1,image2,image3}. +\end{Verbatim} + If a value for this key is not provided, + a message in the log is generated; the images are imported (embedded) in the document, + are not used to create visible images. Either provide a \texttt{placement} key-value pair, + or learn how to use (named) icons that are embedded in the document with the \texttt{\emph{Doc}.importIcon()} + method. +\end{itemize} + +Multiple images can be imported and set by simply executing +\cs{declareImage\-And\-Place\-ment} multiple times with a different set of +arguments, or, by executing \cs{declare\-Multi\-Images}. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \darg{\meta{KV-pairs\_1}}\darg{\meta{KV-pairs\_2}}\darg{\meta{KV-pairs\_3}}...\darg{\meta{KV-pairs\_n}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\declareMultiImages +{ + {!meta(KV-pairs_1)}{!meta(KV-pairs_2)}{!meta(KV-pairs_3)}...{!meta(KV-pairs_n)} +} +\end{dCmd} +\egroup\CmdDescription This command calls the \cs{declareImageAndPlacement} +command for each of its arguments. The argument of the command is a series of +tokens (enclosed in braces); within each pair of matching braces are +\meta{KV-pairs} of the arguments of \cs{declareImageAndPlacement}. The +command \cs{declareMultiImages} loops through the list, calling +\cs{declareImageAndPlacement} with the current set of \meta{KV-pairs}. An +example follows. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \darg{path=graphics/girl.png,placement=\darg{Avatar3,Avatar4}}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\declareMultiImages +{% + {path=graphics/girl.png,placement={Avatar3,Avatar4}} + {path=graphics/AcroFord.jpg,placement=AcroFord} + {path=graphics/scot.gif,placement=Scot} +} +\end{dCmd*} +\egroup + +\Important This command is executed in the preamble only, can be executed more than +once, (once for each image being imported), and \emph{outside of the \texttt{docassembly} environment}. + +Once the images have been defined and referenced using any of the above commands, +you need to actually executed the JavaScript code these commands created. This is done +with the \cs{insertPreDocAssembly} inside the \texttt{docassembly} environment. + +\settowidth{\aebdimen}{\ttfamily\string\insertPreDocAssembly}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\insertPreDocAssembly +\end{dCmd} +\CmdDescription This command expands to all the JavaScript code +created by the commands \cs{declare\-ImageAndPlacement} and +\cs{declareMultiImages}. It is \emph{placed within the +\texttt{docassembly} environment}, like so + +\settowidth{\aebdimen}{\ttfamily\string\insertPreDocAssembly}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{docassembly} +\insertPreDocAssembly +\end{docassembly} +\end{dCmd} + +The target buttons are be created by the \cs{pushButton} command from the \texttt{eforms} package, +but as a convenience, {\AEBP} defines the \cs{placeImage} command + +\settowidth{\aebdimen}{\ttfamily\string\placeImage[\meta{options}]% +\darg{\meta{name}}\darg{\meta{width}}\darg{\meta{height}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\placeImage[!meta(options)]{!meta(name)}{!meta(width)}{!meta(height)} +\end{dCmd} + +\CmdDescription Creates a readonly push button with an icon only appearance. +The \meta{options} can be used to modify the appearance of the button (add a +border, for example); the \meta{name} is used as the field name, and is +referenced in the \texttt{placement} key of \cs{declareImageAndPlacement}. +The \meta{width} and \meta{height} are what they appear to be, the +width and height of the image. + +If the width and height is not correct, \textsf{Acrobat} will scale the +image. There are other controls that can be used through the optional +arguments to position the image within its bounding box. The dimensions of +the image you want to use can be acquired through various methods. On +windows, the dimension of the image for PNG and JPG are displace when the +mouse is moved over the image (while using explorer). + +\textbf{Note.} At times, I have imported images this way, these commands +just simply the task. This method may be preferred over using +\cs{includegraphics} when the image has transparency that you want to +preserve. For example, if a PNG image has a transparent background, it +will be imported into the document with the transparent background. For +those using \textsf{Adobe Distiller}, the transparency is often lost +(unless the image uses vector graphics) when converting to an EPS file. + +\subsubsection{Creating Custom Button Appearances} + +The \cs{placeImage} command described in the last section is a \cs{pushButton} +designed to be read only and is meant to be used to place non-interactive +images in the document. The methods of the previous section can also be used +to create custom button appearances using graphics files of various formats. + +To this end, an optional parameter is defined for the value(s) of the \texttt{placement} +parameter in \cs{declareImageAndPlacement} and \cs{declareMultiImages}. Each button +has (at most) three appearance states: normal, rollover, and down. The additional +optional parameter allows you to specify what appearance state the icon is to be used for. +The optional parameter is shown in the example below. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \darg{path=graphics/girl.png,placement=\darg{[2]Avatar1,[0]Avatar2}}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\declareMultiImages +{% + {path=graphics/man1.pdf,placement={Avatar1,[2]Avatar2}} + {path=graphics/scot.gif,placement={[1]Avatar1,[1]Avatar2}} + {path=graphics/girl.png,placement={[2]Avatar1,[0]Avatar2}} +} +\end{dCmd*} +\egroup The optional argument precedes the field name and determines the +appearance state of the button the icon is to be used; the values +are \texttt{[0]} (default, normal icon); \texttt{[1]} (down icon); +and \texttt{[2]} (rollover icon). There must be no space between the +optional argument and the field name; if you type \texttt{"[2] +Avatar1"}, for example, the field name is interpreted as \texttt{" +Avatar1"}, which is incorrect. + +\exAeBBlogPDF{p=341} Further details and examples may be found in the blog +article \texttt{button\_appr.pdf} titled \emph{Creating Button +Appearances}, found at the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web +site. The source file and images are attached to the PDF. + +\subsubsection{Methods in support of Button +Anime}\label{sss:btnAnimeMethods} + +The commands and methods described in this section are in support for +`\mlnameref{s:btnanime}' on page~\pageref*{s:btnanime}. + +The \texttt{btnanime} option brings in the code necessary to create what I +call button anime, as opposed to OCG anime (using layers). Two +pre-docassembly commands were created for this purpose +\cs{embedMultiPageImages} and \cs{placeAnimeCtrlBtnFaces}. + +\settowidth{\aebdimen}{\ttfamily\string\embedMultiPageImages\darg{\meta{options}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\embedMultiPageImages{!meta(options)} +\end{dCmd} + +\CmdDescription The command embeds (in the document) and optionally places +a series of icons all of which are pages of the same PDF file. This +command does not need the \texttt{btnanime} option, it is part of the core +{\AEB} code. + +\KVP There are a number of key-value pairs the argument recognizes. +\begin{itemize} + \item \texttt{path}: The path to the PDF containing the images to be + used. This path can be relative or absolute. This key is required. + \item \texttt{name}: The base name to be associated with the images + being embedded. This key is required. + \item \texttt{placement}: A comma-delimited list, each member of the list is the + base name of the button anime field created by \cs{btnAnime} that is + to use this set of images. This key is optional, if not present, the + images are embedded only. + \item \texttt{firstpage}: The page number (the first page is page 1) + of the first image to be embedded and used. This key is optional; + if \texttt{firstpage} is not specified, its default value is 1. + \item \texttt{lastpage}: The page number (base-1 page numbering) of + the last image to be embedded and used. The value of this key is + required. +\end{itemize} + +For example, here we embed the first 41 pages from the file +\texttt{sine\_anime.pdf}, which resides in the subfolder \texttt{graphics}, +and associates it with the button anime field \texttt{mysine}. +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily path=graphics/sine\_anime.pdf,placement=mysine\}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\embedMultiPageImages{lastpage=41,name=sine, + path=graphics/sine_anime.pdf,placement=mysine} +\end{dCmd*} +\egroup + +The control buttons for a button anime require a custom appearance. +{\AEBP} supplies one set of custom icons, and allows for the creation +of more by the interested document author, that's you. + +\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces[\meta{path}]% +\darg{\anglemeta{appr\_icons}.pdf}\darg{\meta{list\_of\_animes}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\placeAnimeCtrlBtnFaces[!meta(path)]{!anglemeta(appr_icons).pdf}{!meta(list_of_animes)} +\end{dCmd} + +\CmdDescription This command associate the icon set to be used for the +button appearances of the buttons used to control the button animation. +(That's a lot of buttons in that last sentence!) + +\PD The command takes three parameters, one of which is optional. +\begin{description} + \item[\normalfont\texttt{[\meta{path}]}] is the (optional) path to the button control + appearance icons. If no argument is present, + the value of \cs{pathToBtnCtrlIcons} is used, see \texttt{aebpro.cfg} + for its definition. The icon set distributed with {\AEBP} is named + \texttt{btn\_anime\_icons1.pdf}, and is found in the icons folder of + the \texttt{aeb\_pro} folder. + \item[\normalfont\texttt{\anglemeta{appr\_icons}}] is the name of the PDF file that + contains the icons to be used for the appearances of the control + buttons. + \item[\normalfont\texttt{\meta{list\_of\_animes}}] is a comma-delimited list of the base + names of the anima created by \cs{btnAnima} that will be using these + appearance icons. +\end{description} + +\textbf{Example:} +\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces\darg{btn\_anime\_icons1.pdf}\darg{myclock,mysine}}% +\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule} +\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myclock,mysine} +\end{dCmd*} + +The above example uses no optional parameter, so \cs{placeAnimeCtrlBtnFaces} uses the path defined +by \cs{pathToBtnCtrlIcons} in \texttt{aebpro.cfg}. On my personal system, +the \texttt{aebpro.cfg} file reads +\begin{Verbatim} +% +% AeB Pro Configuration file +% +\ExecuteOptionsX{driver=dvips} +\renewcommand{\pathToBtnCtrlIcons} + {C:/Users/Public/Documents/My TeX Files/tex/latex/aeb_pro/icons} +\end{Verbatim} +You should seek out the \texttt{aebpro.cfg} and edit this command to point +to the \texttt{icons} folder of \texttt{aeb\_pro.} You can create your own +icon PDF file in the \texttt{icons} folder; the guidelines for creating +such an icon PDF file are simple. Places the icon from each page as the +appearance of a corresponding control button. The expected order of the +icons is given in \hyperref[fig:apprCntrls]{Figure~\ref*{fig:apprCntrls}}, +page~\pageref*{fig:apprCntrls}. + +If you put your custom appearance icon set in the source folder, you can +reference like so, +\begin{Verbatim} +\placeAnimeCtrlBtnFaces[.]{btn_anime_custom.pdf}{myclock,mysine} +\end{Verbatim} +The optional \texttt{[.]} overrides the definition of +\cs{pathToBtnCtrlIcons}, and refers to the current folder. If you never +defined \cs{pathToBtnCtrlIcons} (its default definition is empty), then +\begin{Verbatim} +\placeAnimeCtrlBtnFaces{btn_anime_custom.pdf}{myclock,mysine} +\end{Verbatim} +does the trick. If you have them in a subfolder (\texttt{graphics}) of the source file folder, +then +\begin{Verbatim} +\placeAnimeCtrlBtnFaces[graphics]{btn_anime_custom.pdf}{myclock} +\end{Verbatim} + +\begin{figure}[htb]\centering +\begin{tabular}{cl} + Page & Icon\\\hline + 0 & Go to first frame\\ + 1 & Go to last frame\\ + 2 & Step back one frame\\ + 3 & Step forward one frame\\ + 4 & Play backward\\ + 5 & Play forward\\ + 6 & Pause\\ + 7 & Increase speed\\ + 8 & Decrease speed +\end{tabular} +\caption{Icons by page for Button Anime Controls}\label{fig:apprCntrls} +\end{figure} + +Finally, because these are pre-docassembly methods, these two commands go +in the preamble, and are followed by the \texttt{docassembly} environment; +like so,\dots + +\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces\darg{btn\_anime\_icons1.pdf}\darg{myAnimation,mysine}}% +\begin{dCmd*}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\embedMultiPageImages{lastpage=36,name=rotate, + path=graphics/animation.pdf,placement=myAnimation} +\embedMultiPageImages{lastpage=41,name=sine, + path=graphics/sine_anime.pdf,placement=mysine} +\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myAnimation,mysine} +\begin{docassembly} +\insertPreDocAssembly; +\executeSave(); +\end{docassembly} +\end{dCmd*} +You may have other pre-docassembly commands as well. + + +\section{Linking to Attachments}\label{linktoattachments} + +Should you wish to link to your attachments or \emph{rename their +descriptions}, the \texttt{link\-to\-at\-tach\-ments} option needs to be specified in the +option list of \texttt{aeb\_pro}. This defines many of the commands +discussed in this section enabling you to link to a PDF attachment, +open a PDF or non-PDF attachment, save a PDF or non-PDF +attachment to the local hard drive, or simply to rename the descriptions +of the attachments. + +\exPDFSrc{aebpro_ex5} The document \texttt{aebpro\_ex5} has working examples +of the ideas and commands discussed in this section. + +\penalty-1000 + +\subsection{Naming Attachments} + +Associated with each embedded file is a name (or label) and a description. +The name given to an attachment (an embedded file) is used by \textsf{Acrobat} +to reference its location within the embedding {\PDF} document. This name (or +label) is used when creating links to the embedded document as well; +consequently, the assigned name is quite important. + +\subsubsection{Default Descriptions and Labels} + +With {\cAEBP}, \texttt{you} can attach files in three ways: (1) with the \texttt{attachsource} key, +(2) with the attachments key; and (3) using the \cs{importDataObject} method, as +demonstrated in \hyperref[importdataobject]{Example~\ref{importdataobject}}. For attachments +that fall into categories (1) and (2), {\AEB} assigns default labels and descriptions. These +are presented in \hyperref[deflabelnames]{Table~\ref*{deflabelnames}}, page~\pageref*{deflabelnames}. + +\begin{table}[ht]\centering +\begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l} +attachsource & \textrm{label} & \textrm{description}\\\hline + tex & tex & \cs{jobname.tex}\\ + dvi & dvi & \cs{jobname.dvi}\\ + log & log & \cs{jobname.log}\\ + $\dots$&$\dots$ & $\dots$\\[2ex] +attachments & \textrm{label} & \textrm{description}\\\hline +$1^{\text{st}}$ file & attach1 & {\AEB} Attachment 1\\ +$2^{\text{nd}}$ file & attach2 & {\AEB} Attachment 2\\ +$3^{\text{rd}}$ file & attach3 & {\AEB} Attachment 3\\ +$4^{\text{th}}$ file & attach4 & {\AEB} Attachment 4\\ + $\dots$ & $\dots$ & $\dots$ + +\end{tabular} +\caption{Default label/descriptions}\label{deflabelnames} +\end{table} + +For documents attached by \texttt{attachsource}, the default label is the extension, +and the default description is the filename with extension. + +For documents attached by the \texttt{attachments} option, {\cAEBP} +assigns them ``names,'' which appear in the attachments tab of +\textsf{Acrobat/Reader} as the Description.\footnote{The Description is +important as it is the way embedded files are referenced internally.} The +names assigned are \texttt{{\AEB} Attachment 1}, \texttt{{\AEB} Attachment 2}, +\texttt{{\AEB} Attachment 3}, and so on. + +If you embed a file using the \cs{importDataObject} method within the +\texttt{docassembly} environment (see +\hyperref[importdataobject]{Example~\ref{importdataobject}}, +page~\pageref*{importdataobject}), you are free to assign a name of your +preference. + +\subsubsection{Assigning Labels and Descriptions}\label{assigningLabels} + +Whatever method is used to attach a document to the parent document, +the names must be converted to unicode on the {\TeX} side of things +to set up the links, and there must be a \LaTeX-like way of +referencing this unicode name, hence the development of the +\texttt{at\-tach\-ments\-Names} environment and the two commands +\cs{autolabelNum} and \cs{labelName}.\footnote{It is important to +note that these are not needed unless you are linking to the +embedded files.} These two commands, described below, should appear +in the \texttt{attachment\-Names} environment in the preamble. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \anglemeta{\string\autolabelNum{} and \string\labelName{} commands}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{attachmentNames} + !anglemeta(\autolabelNum and \labelName commands) +\end{attachmentNames} +\end{dCmd} +\egroup + +\EnvLoc The preamble of the document. The \texttt{attachmentNames} +environment and the commands \cs{autolabel\-Num} and \cs{labelName} +should be used only in the parent document; for child documents they +are not necessary. + + +\Ex{}\label{declarations} Below are the declaration that appear in +the supporting file \texttt{aebpro\_ex5}: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{attachmentNames} + \autolabelNum{1} + \autolabelNum*{2}{target2.pdf Attachment File} + \autolabelNum*[AeST]{3}{{\AEB}ST Components} + \labelName{cooltarget}{My (cool) $|x^3|$ ~ % '<attachment>'} +\end{attachmentNames} +\end{Verbatim} +Descriptions of these commands follow. + +\settowidth{\aebdimen}{\ttfamily\string\autolabelNum[\meta{label}]\darg{\anglemeta{num}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\autolabelNum[!meta(label)]{!anglemeta(num)} +\end{dCmd} + +\CmdDescription For PDFs (or other files) embedded using the +\texttt{attachments} option, use the \cs{autolabelNum} command. + +\PD The first optional argument is the label to be used to refer to this +embedded file; the default is \anglemeta{num}. The second +argument is the second is a number, \anglemeta{num}, which +corresponds to the order the file is listed in the value of the +\texttt{attachments} key.\footnote{To minimize the number of changes +to the document, if you later add an attachment, add it to the end +of the list so the earlier declarations are still valid.} + + +\newtopic There is a star form of \cs{autolabelNum}, which +allows to change the description of the attachment. +\settowidth{\aebdimen}{\ttfamily\string\autolabelNum*[\meta{label}]\darg{\anglemeta{num}}\darg{\anglemeta{description}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\autolabelNum*[!meta(label)]{!anglemeta(num)}{!anglemeta(description)} +\end{dCmd} +\CmdDescription Each file listed as a value in the \texttt{attachments} key +has a number, \anglemeta{num}, assigned to it according to the order it +appears in the list, and a default description + of `\texttt{{\AEB} Attachment \anglemeta{num}}'. This command +allows you not only to change the label, but to change the +description of the attachment as well. + +\PD The first optional argument is the label to be used to refer to this +embedded file; the default is \texttt{attach\anglemeta{num}}. The second +argument is the second is a number, \anglemeta{num}. The third parameter, +\anglemeta{description}, is the description that will appear in the +attachments pane of \textsf{Acrobat/Reader}. + +\newtopic For files that are embedded using +\cs{importDataObject}, use the command \cs{labelName} for assigning +the name, and setting up the correspondence between the name and the +label. +\settowidth{\aebdimen}{\ttfamily\string\labelName\darg{\meta{label}}\darg{\anglemeta{description}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\labelName{!meta(label)}{!anglemeta(description)} +\end{dCmd} +\PD The first argument is the label to be used to reference this embedded +file. The second parameter, \anglemeta{description}, you can assign an +arbitrary name used for the description. + + +\subsubsection{Notes on the +\texorpdfstring{\protect\anglemeta{description}}{<description>} parameter}\label{description} + +The \anglemeta{description} parameter used in \cs{autolabelNum*} and +\cs{labelName} can be an arbitrary string assigned to the description of this +embedded file, the characters can be most anything in the Basic Latin unicode +set, 0021--007E, with the exception of left and right braces \verb!{}!, +backslash \verb!\! and double quotes \texttt{"}. + +%If you take the \texttt{latin1} option, the unicodes for 00A1--00FF are also included. + +A unicode character code can also be entered directly into the +description by typing \cs{uXXXX}, where \texttt{XXXX} are +four hex digits. (Did I say not to use `\verb!\!'?) This is very +useful when using the trouble making characters such as backslash, +left and right braces, and double quotes, or using unicode above +00FF (Basic Latin + Latin-1). To illustrate, suppose we wish the +description of \texttt{cooltarget} to be +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] + "$|e^{\ln(17)}|$" +\end{Verbatim} +All the bad characters! +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\labelName{cooltarget}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022} +\end{Verbatim} +From the unicode character tables we see that + +\begingroup\parskip0pt +\begin{itemize} +\item left brace \cs{u007B} +\item right brace \cs{u007D} +\item backslash \cs{u005C} +\item double quotes \cs{u0022} +\end{itemize} +\par\endgroup +\exPDFSrc{aebpro_ex6} See the example file \texttt{aebpro\_ex6.tex} +for additional examples of the use of \cs{uXXXX} character codes. + +There are several ``helper'' commands as well: \cs{EURO}, +\cs{DQUOTE}, \cs{BSLASH}, \cs{LBRACE} and \cs{RBRACE}. When the +\cs{u} is detected, an \cs{expandafter} is executed. This allows a +command to appear immediately after the \cs{u}, things work out well +if the command expands to four hex numbers, as it should. Thus, +instead of typing \cs{u0022} you can type \verb!\u\DQUOTE!. + +\subsection{Linking to Embedded Files}\label{embed} + +This package defines two commands, \cs{ahyperref} and +\cs{ahyperlink}, to create links between parent and child and child +and child. The default behavior of \cs{ahyperref} (and +\cs{ahyperlink}) is to set up a link from parent to child. +\cs{ahyperlink} and \cs{ahyperref} are identical in all respects +except for how it interprets the destination. (Refer to +\mlNameref{jump} for details.) + +\newtopic The commands each take three arguments, the +first one of which is optional +\settowidth{\aebdimen}{\ttfamily\string\ahyperlink[\meta{options}]% +\darg{\meta{target\_label}}\darg{\meta{text}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\ahyperref[!meta(options)]{!meta(target_label)}{!meta(text)} +\ahyperlink[!meta(options)]{!meta(target_label)}{!meta(text)} +\end{dCmd} +\CmdDescription \cs{ahyperref} is used to jump to a destination (as +specified by the \texttt{dest} key, listed in +\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}) +defined by the \cs{label} command, whereas \cs{ahyperlink} is used +to jump to a destination (as specified by the \texttt{dest} key) +defined by the \cs{hypertarget} of \textsf{hyperref}. See +\hyperref[jump]{Section~\ref*{jump}}, page~\pageref*{jump} for details. + +\PD The commands each take three arguments, the first one of which +is optional. +\begingroup\parskip0pt +\begin{aebDescript} + \item [\meta{options}] are the options for modifying the appearance of + the link, and for specifying the relationship between the source and + the target file. These are key-value pairs documented + in \hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}. + \item \meta{target\_label} is the label of the target file, the label is + the default label, if there is one, or as defined by + \cs{autolabelNum} or \cs{labelName}. + \item [\meta{text}] is the text that is highlighted for this link. +\end{aebDescript} +\par\endgroup + +\begin{table}[ht]\centering\small +\begin{tabular}{|>{\ttfamily}l|>{\ttfamily\raggedright}p{1.3in}|p{2.5in}|}\hline +\textbf{Key} &\textbf{Value}&\textbf{Description}\\\hline +goto &p2c, c2p, c2c & The type of jump, parent to child, child to parent, and child to + child. The default is \texttt{p2c}.\\[1ex] +page &\anglemeta{number}& The page of the embedded document to jump to. Default is \texttt{0}.\\[1ex] +view &\anglemeta{value} & The view to be used for the jump. Default is \texttt{Fit}.\\[1ex] +dest &\anglemeta{string}& Jump to a named destination. When this key has a value, the values + of the keys \texttt{page} and \texttt{view} are ignored.\\[1ex] +open &usepref, new, existing + & Open the attachment according to the user preferences, + a new window, or the existing window. The default is \texttt{userpref}.\\[1ex] +border &visible, invisible + & Determines whether a visible rectangle appears around the + link. The default is \texttt{in\-vis\-i\-ble}.\\[1ex] +highlight &none, invert, outline, insert + & How the viewer highlights the link when the + link is clicked. The default is \texttt{invert}.\\[1ex] +bordercolor &r g b & The color of the border when it is visible. The default is black.\\[1ex] +linestyle &solid, dashed, underlined + & The line style of the border when it is visible. + The default is \texttt{solid}.\\[1ex] +linewidth &thin, medium, thick + & The line width when the border is visible. When invisible, + this is set to a width of zero. The default is \texttt{thin}.\\[1ex] +preset &\anglemeta{\cs{presetCommand}} + & A convenience key. You can define some preset values.\\\hline +\end{tabular} +\caption{Key-value pairs for links to embedded files}\label{aKeyVal} +\end{table} + +\Ex{} We assume the declarations as given in \hyperref[declarations]{Example~\ref*{declarations}}, +page~\pageref*{declarations}. In the simplest case, we jump from the parent to the first page of a +child file given by$\dots$ +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] + \ahyperref{attach1}{target1.pdf} +\end{Verbatim} +This is the same as +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] + \ahyperref[goto=p2c]{attach1}{target1.pdf} +\end{Verbatim} +The \texttt{goto} key is one of the key-value pairs taken by the +optional argument. Permissible values for the \texttt{goto} key are +\texttt{p2c} (the default), \texttt{c2p} (child to parent) and +\texttt{c2c} (child to child). + +\Ex{} We assume the declarations as given in \hyperref[declarations]{Example~\ref*{declarations}}, +page~\pageref*{declarations}. Similarly, link to the other embedded files in this parent: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] + \ahyperref{attach2}{target2.pdf} + \ahyperref{cooltarget}{aebpro\_ex2.pdf} +\end{Verbatim} + +In all cases above, the \cs{ahyperlink} command could have been +used, because no \emph{named} destination was specified, without a +named destination, the these links jump to page~1. + + +\subsection{Jumping to a target}\label{jump} + +As you may know, {\LaTeX}, more exactly, \texttt{hyperref} has two +methods of jumping to a target in another document, jump to a label +(defined by \cs{label}) and jump to a target set by +\cs{hypertarget}. Each of these is demonstrated for embedded files +in the next two sections. + +\exPDFSrc{aebpro_ex5} The document \texttt{aebpro\_ex5} has working examples +of the ideas and commands discussed in this section. + +\subsubsection{Jumping to a \texorpdfstring{\protect\cs{hypertarget}}{\textbackslash hypertarget} +with \texorpdfstring{\protect\cs{ahyperlink}}{\textbackslash ahyperlink}} + +Suppose there is a destination, with a label of \texttt{mytarget}, defined +by the \cs{hypertarget} command in \texttt{target1.pdf}. To jump to +that destination we would use the following code: +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperlink[dest=mytarget]{attach1}{Jump!} +\end{Verbatim} +Note that \texttt{dest=mytarget}, where \texttt{mytarget} is the +label assigned by the \cs{hypertarget} command in \texttt{target1.pdf}. + +\penalty-5000 + +\subsubsection{Jumping to a \texorpdfstring{\protect\cs{label}}{\textbackslash label} +with \texorpdfstring{\protect\cs{ahyperref}}{\textbackslash ahyperref}} + +{\LaTeX} has a cross-referencing system, to jump to a target set by +the \cs{label} command we use the \textsf{xr-hyper} package that +comes with \texttt{hyperref}; the code might be + +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperref[dest=target1-s:intro]{attach1} + {Section~\ref*{target1-s:intro}} +\end{Verbatim} +we set \verb!dest=target1-s:intro!. + +The label in \texttt{target1.pdf} is \texttt{s:intro}, in the preamble of +this document we have +\begin{Verbatim}[xleftmargin=\amtIndent] +\externaldocument[target1-]{children/target1} +\end{Verbatim} +\noindent which causes \textsf{xr-hyper} to append a prefix to the label (this +avoids the possibility of duplication of labels, over multiple +embedded files). + + +\subsection{Optional Args of \texorpdfstring{\protect\cs{ahyperref}}{\textbackslash ahyperref} +and \texorpdfstring{\protect\cs{ahyperlink}}{\textbackslash ahpyerlink}} + +The \cs{ahyperref} commands has a large number of optional arguments, see +\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}, +enabling you to create any link that the user interface of \textsf{Acrobat +Pro} can create, and more. These are documented in \textsf{aeb\_pro.dtx} +and well as the main documentation. Suffice it to have an example or two. + +By using the optional parameters, you can create any link the UI can create, for example, +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperref[% + dest=target1-s:intro, + bordercolor={0 1 0}, + highlight=outline, + border=visible, + linestyle=dashed +]{attach1}{Jump!} +\end{Verbatim} +\noindent Now what do you think of that? + +\newtopic The argument list can be quite long, as shown above. If you have some favorite settings, you can +save them in a macro, like so, +\begin{Verbatim}[xleftmargin=\amtIndent] +\def\preseti{bordercolor={0 0 1},highlight=outline,open=new,% + border=visible,linestyle=dashed} +\end{Verbatim} +Then, we can say more simply, %\ahyperref[dest=target1-s:intro,preset=\preseti]{attach1}{Jump!} +This link is given by$\dots$ +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperref[dest=target1-s:intro,preset=\preseti]{attach1}{Jump!} +\end{Verbatim} +\noindent I've defined a \texttt{preset} key so you can predefine +some common settings you like to use, the enter these settings +through preset key, like so \verb!preset=\preseti!. Cool. + +Note that in the second example, \texttt{open=new} is included. This +causes the embedded file to open in a new window. For +\textsf{Acrobat/Reader} operating in MDI, a new child window will open; +for SDI (version~8), and if the user preferences allows it, it will open +in its \textsf{Acrobat/Adobe Reader} window. + + +\subsection{Opening and Saving with \texorpdfstring{\protect\cs{ahyperextract}} + {\textbackslash ahyperextract}} + +In addition to embedding and linking a PDF, you can embed most any +file and programmatically (or through the UI) open and/or save it to +the local file system. + +To attach a file to the parent PDF, you can use the +\texttt{attachsource} or the \texttt{attachments} options of +{\cAEBP}, or you can embed your own using the +\texttt{importDataObject} method, as described earlier in this file. + +If an embedded file is a PDF, you can link to it using \cs{ahyperref} or +\cs{ahyperlink}; we can jump to an embedded PDF and jump back. If the +embedded file is not a PDF, then jumping to it makes no sense; the best we +can do is to open the file (using an application to display the file) and/or +save it to the local hard drive. + +The {\cAEBP} package has the command \cs{ahyperextract} to extract +the embedded file, and to save it to the local hard drive, with an +option to start the associated application and to display the file. +The syntax for \cs{ahyperextract} is the same as that of the other +two commands: +\settowidth{\aebdimen}{\ttfamily\string\ahyperextract[\meta{options}]% +\darg{\meta{target\_label}}\darg{\meta{text}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\ahyperextract[!meta(options)]{!meta(target_label)}{!meta(text)} +\end{dCmd} +\PD The \meta{options} are the same as those for \cs{ahyperref} (refer to +\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}), the +\meta{target\_label} is the one associated with the attachment name, +and the \meta{text} is the link text. + +In addition to the standard options of \cs{ahyperref}, +\cs{ahyperextract} recognizes one additional key, \texttt{launch}. +This key accepts three values: \texttt{save} (the default), +\texttt{view} and \texttt{viewnosave}. The following is a partial +verbatim listing of the descriptions given in the \textsl{JavaScript +for Acrobat API Reference}, in the section describing +\texttt{importDataObject} method of the Doc object: +\begin{enumerate} + \item \texttt{save}: The file will not be launched after it is + saved. The user is prompted for a save path. + \item \texttt{view}: The file will be saved and then launched. + Launching will prompt the user with a security alert warning if + the file is not a PDF file. The user will be prompted for a save + path. + \item \texttt{viewnosave}: The file will be saved and then + launched. Launching will prompt the user with a security alert + warning if the file is not a PDF file. A temporary path is + used, and the user will not be prompted for a save path. The + temporary file that is created will be deleted by + \textsf{Acrobat} upon application shutdown. +\end{enumerate} + +\Ex{} Here is a series of examples of usage: +\begin{enumerate} + +\item Launch and view this PDF. The code is\makeatletter\@listdepth=0\relax\makeatother + +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperextract[launch=view]{cooltarget}{aebpro\_ex3.pdf} +\end{Verbatim} +When you extract (or open) PDF in this way, any links created by +\cs{ahyperref} or \cs{ahyper\-link} will not work since the PDF being +viewed is no longer an embedded file of the parent. + +\item View the a file, but do not save. The code is\makeatletter\@listdepth=0\relax\makeatother +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperextract[launch=viewnosave]{tex}{aebpro\_ex5.tex} +\end{Verbatim} +Note that for attachments brought in by the \texttt{attachsource} option, +the label for that attachment is the file extension, in this case +\texttt{tex}. + +\item Save a file without viewing.\makeatletter\@listdepth=0\relax\makeatother +\begin{Verbatim}[xleftmargin=\amtIndent] +\ahyperextract[launch=save]{AeST}{{\AEB}ST Component List} +\end{Verbatim} +\end{enumerate} + +\subsection{The child document}\label{childof} + +If one of the documents to be attached is a PDF document created from +a {\LaTeX} source using {\cAEBP}, and you want link back to either the +parent document or another child document, then use the \texttt{childof} +option in the \texttt{aeb\_pro} option list. The value of this key +is the path back to the base name of the parent document. For example, +a child document might specify \verb!childof={../aebpro_ex5}!. + +\exPDFSrc{aebpro_ex5} See the support documents +\texttt{aebpro\_ex5}, the parent document and its two child +documents \texttt{children/target1} and \texttt{children/target2}, +found in the examples folder. + +\section{Creating a PDF Package} + +% 8.2.4 p. PDF 1.7 (v8)) 588 collection (portable collection, PDF collection), PDF package, PDF portfolio + + +The concept of a PDF Package is introduced in \textsf{Acrobat}~8. On first +blush, it is nothing more than a fancy user interface to display embedded +files; however, it is also used in the new email form data workflow. +Using the new \textsf{Forms} menu, data contained in FDF files can be +packaged, and summary data can be displayed in the user interface. +Consequently, the way forms uses it, a PDF package can be used as a simple +database. + +Unfortunately, at this time, the form feature/database feature of +PDF Packages is inaccessible to the JavaScript API and {\cAEBP}. +What {\cAEBP} provides is packaging of the embedded files with the +nice UI. + +\exPDFSrc{aebpro_ex6} The document \texttt{aebpro\_ex6} provides a working +example of a PDF Package. + +\newtopic To create a PDF Package, embed all files in the +parent and use the command \cs{make\-PDF\-Pack\-age} in the preamble to +package the attachments. + +\settowidth{\aebdimen}{\ttfamily\string\makePDFPackage\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\makePDFPackage{!meta(KV-pairs)} +\end{dCmd} +\KVP There are only two sets of key-value pairs +\begin{aebDescript} + \item [\texttt{initview=\anglemeta{label}}] Specifying a value for the + \texttt{initview} key determines which file will be used as the initial + view when the document is opened. If, for example, \texttt{initview=attach2}, + the file corresponding to the label + \texttt{attach2}, as set up in the \texttt{at\-tach\-ment\-Names} + environment is the initial view. Listing \texttt{initview} with + no value (or if \texttt{initview} is not listed at all) causes + the parent document to be initially shown. + + \item [\texttt{viewmode=\anglemeta{\upshape details|tile|hidden}}] The + \texttt{viewmode} determines which of three user interfaces + is to be used initially. In terms of the UI terminology: +\begin{align*} + &\texttt{details} = \textsf{View top}\\ + &\texttt{tile} = \textsf{View left}\\ + &\texttt{hidden} = \textsf{Minimize view} +\end{align*} + The default is \texttt{details}. +\end{aebDescript} +If you use this command with an empty argument list, +\verb!\makePDFPackage{}!, you create a PDF package with the +defaults. + +\newtopic\textbf{\textcolor{red}{TIP:}} Use the \cs{autolabelNum*} +command to assign more informative descriptions to the attachments, +like so. +\begin{Verbatim}[xleftmargin=\amtIndent] +\autolabelNum*{1}{European Currency \u20AC} +\autolabelNum*{2}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022} +\autolabelNum*[AeST]{3}{The {\AEB}ST Components} +\autolabelNum*[atease]{4}{The @EASE Control Panel} +\end{Verbatim} + +\newtopic\textbf{\textcolor{red}{Warning:}} There seems to be a bug +when you email a PDF Package. When the initial view is \emph{not a +PDF document}, the PDF Package is corrupted when set by email and +cannot be opened by the recipient. When emailing a PDF Package, as +produced by {\cAEBP}, always have the initial view as a PDF document. + +\section{Initializing a Text Field with Unicode} + +One of the side benefits of the work on linking to attachments of a +PDF document is that the techniques are now in place to be able to initialize +a text field using unicode characters. + +The technique uses a combination of a recently introduced command \Com{labelName} +and a new command \Com{unicodeStr}. +\settowidth{\aebdimen}{\ttfamily\string\labelName\darg{\meta{label}}\darg{\meta{string}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\labelName{!meta(label)}{!meta(string)} +\unicodeStr{!meta(label)} +\end{dCmd} + +\PD The parameter \meta{label} is a {\LaTeX}-type of label name, and \meta{string} +is a combination of ASCII characters and unicodes \cs{uXXXX}, as described earlier +(Review the discussion in \Nameref{assigningLabels}). + +\CmdDescription The command \cs{unicodeStr} takes its argument, which is \emph{delimited by +parentheses}, looks up the string referenced by \meta{label} and converts the string +to unicode. The unicode tables that come with {\cAEBP} are used to look up any ASCII +characters; for characters that are available on a standard keyboard, unicode escape +sequences can be used. This is illustrated below. + +For example, we first define a unicode string, and reference it using a label. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\labelName{myCoolIV}{\u0022\u20AC|e^\u007B\u005Cln(17)\u007D|$\u0022} +\end{Verbatim} +Note that the use of \cs{labelName} \emph{should not occur} within the \texttt{{attachmentNames}} +environment, this is for linking to attachments. Here, \cs{labelName} can be used anywhere +before the creation of the text field. + +Then we can define a text field with this value as its initial value +and its default value like so,\labelName{myCoolIV}{\u0022\u20AC|e^\u007B\u005Cln(17)\u007D|$\u0022} +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] + \textField[\textSize{10}\textFont{MyriadPro-Regular} + \uDV{\unicodeStr(myCoolIV)} + \uV{\unicodeStr(myCoolIV)} + ]{myCoolIV}{1.5in}{12bp} +\end{Verbatim} +\par\smallskip +The result is the field + \textField[\textSize{10}\textFont{MyriadPro-Regular} + \uDV{\unicodeStr(myCoolIV)}\uV{\unicodeStr(myCoolIV)}]{myCoolIV}{1.5in}{12bp} + \pushButton[\textSize{10}\textFont{MyriadPro-Regular}\CA{Reset}\A{\JS{this.resetForm(["myCoolIV"])}}]{reset}{}{12bp} + +The technique uses special keys as optional arguments of +the command \cs{textField} (defined in the eforms package). The keys \cs{uDV} and \cs{uV} signal +to the eforms package that the string is given in unicode. + +\exPDFSrc{aebpro_ex8} The support document \texttt{aebpro\_ex8} is a short tutorial +on these topics, including additional examples on creating a button and combo box that +use unicode encoded strings. + + +\section{Using Layers, Rollovers and Animation.}\label{layers} + + +When the \texttt{uselayers} option is taken, the necessary code is +input to produce layers (Optional Content Groups). The +\textcolor{blue}{{\AcroTeX} Presentation Bundle} (APB), which has a +very sophisticated method of control over layers, by comparison, the +\textcolor{blue}{{\cAEBP}} layer support is very primitive indeed. As +a rule, after you create a layer, you will need a control of that +layer. This could be a button or a link that executes JavaScript. + +\settowidth{\aebdimen}{\ttfamily\string\xBld[true|false|print=\anglemeta{\upshape{true|false}}]% +\darg{\meta{layer\_name}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\xBld[true|false|print=!anglemeta(!upshape(true|false))]{!meta(layer_name)} + !anglemeta(content of layer) +\eBld +\end{dCmd} + +\CmdDescription The basic command for creating a layer is \cs{xBld}. +The content of the layer is set off by the \cs{xBld}/\cs{eBld} pair. + +\PD The command \cs{xBld} takes two parameters: (1) the first is +optional, \texttt{true} if the layer is initially visible or +\texttt{false}, the default, if the layer is hidden initially; (2) +the name of the layer, this is used to reference the layer, to make +it visible or hidden. The \texttt{print} key sets the printing attribute +of the of the layer: +\begin{itemize} + \item\texttt{print=true} (or just \texttt{print}): the layer + \emph{always prints}, no matter if it is visible or not. + \item\texttt{print=false}: the layer \emph{never prints}, no matter if it is visible or not. + \item If the print key does appear in the list of optional parameters, + the layer will print if visible, otherwise, it does not print. Normally, the \texttt{print} + key is not specified, and the layer is printed only if visible. +\end{itemize} + +A link can be made visible or hidden by getting its OCG object and setting +the \texttt{state} property. A simple example of this would be$\dots$ +\begin{Verbatim}[xleftmargin=\amtIndent] +\setLinkText[% +\A{\JS{% + var oLayer = getxBld("mythoughts"); + if ( oLayer != null ) + oLayer.state = !oLayer.state; + }} +]{\textcolor{red}{Click here}} +\end{Verbatim} +The link text has a JavaScript action. First we get the OCG object +for this layer by calling the \texttt{getxBld} function (this is +part of the {\cAEBP} JavaScript) then if non-null (you may not have +spelled the name correctly) we toggle the current state, +\texttt{oLayer.state = !oLayer.state}. + +This is such a common action that a formal JavaScript function is +defined by {\cAEBP} +\begin{Verbatim}[xleftmargin=\amtIndent] +\setLinkText[% +\A{\JS{toggleSetThisLayer("mythoughts");}} +]{\textcolor{red}{Click here}} +\end{Verbatim} +The above examples uses a link, but a form field action can also be used. + +\newtopic An advantage of the layers approach is that the content of the +layers are latexed as part of the content of the tex file; consequently, +you can include virtually anything in your layer that tex can handle, +math, figures, PSTricks, etc. \textsf{Acrobat Pro}~7.0 (and +\textsf{Distiller}) or later is required to build the layers, but only +\textsf{Adobe Reader~7.0} or later is needed to view the document, once +constructed. + +\exAeBBlogPDF{p=326} The file \texttt{xbld\_options.pdf} is a +demo of the optional parameters for \cs{xBld} of this section. The +source file and images are attached to the PDF. The PDF, titled +\textsl{Exploring the options of \cs{xBld}}, is found at the +\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site. + + +\subsection{Rollovers} + +The {\cAEBP} package offers you two rollovers, which ostensibly +provides help to the document consumer. + +\exPDFSrc{aebpro_ex4} These topics are illustrated in the support +file \texttt{aebpro\_ex4}. + + +\subsection{Using the form field tool tip feature} + +The \cs{texHelp} is a command for creating a rollover for some text. +When the user rolls over the text, a defined layer is made visible +with helpful information. See \texttt{aebpro\_ex4} for working +examples and extensive details. + +\subsection{Layers and Animation} + +Let's see if we can conjure up a little animation, shall we? + +\exPDFSrc{aebpro_ex4} A working version of this example appears in \texttt{aebpro\_ex4}. + +\Ex{} This examples create a sine graph using PSTricks. When the start button is pressed, +the function will be graphed in an animated sort of way. + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small] +\begin{minipage}{.65\linewidth}\centering +\DeclareAnime{sinegraph}{10}{40} +\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld} +\psset{llx =-12pt,lly=-12pt,urx =12pt,ury =12pt} +\begin{psgraph*}[arrows=->](0,0)(-.5,-1.5)(6.5,1.5){164pt}{70pt} + \psset{algebraic=true}% + \rput(4,1){$y=\sin(x)$} + \FPdiv{\myDelta}{\psPiTwo}{\nFrames}% + \def\xi{0}% + \multido{\i=1+1}{\nFrames}{\FPadd{\xi}{\xi}{\myDelta}\thisframe} +\end{psgraph*} +\end{minipage}\hfill +\begin{minipage}{.3\linewidth} +\backAnimeBtn{24bp}{12bp}\kern1bp\clearAnimeBtn{24bp}{12bp}\kern1bp +\forwardAnimeBtn{24bp}{12bp} +\end{minipage} +\end{Verbatim} +You will have to delve through the working version of this example in \texttt{aebpro\_ex4} +to fully understand it. + +\settowidth{\aebdimen}{\ttfamily\string\DeclareAnime\darg{\meta{basename}}\darg{\meta{speed}}\darg{\meta{nframes}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\DeclareAnime{!meta(basename)}{!meta(speed)}{!meta(nframes)} +\end{dCmd} +This sets the basic parameters of an anime: the base name for the animation, the speed of the animation +as measured in milliseconds, and the number of frames to appear in the anime. + +\settowidth{\aebdimen}{\ttfamily\string\animeBld\anglemeta{frame\_content}\string\eBld}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\animeBld!anglemeta(frame_content)\eBld +\end{dCmd} +This \cs{animeBld}/\cs{eBld} pair enclose the ``i$^\text{th}$'' frame. + +\settowidth{\aebdimen}{\ttfamily\string\forwardAnimeBtn[\meta{opts}]\darg{\meta{width}}\darg{\meta{height}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\backAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)} +\clearAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)} +\forwardAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)} +\end{dCmd} +These are basic button controls for the anime: back, stop/clear, and forward. Each of these has an +optional parameter where you can modify the appearance of the button. See the eforms manual for details of +these optional parameters. + +\section{Button and Ocg Anime}\label{s:btnanime} + +In this section. we introduce some commands and one environment for +creating button and OCG anime (see page~\pageref*{ss:ocganime}). + +\subsection{The \texorpdfstring{\protect\cs{btnAnime}}{\CMD{btnAinme}} Command}\label{ss:btnanime} + +When animating with layers, we create a series of frames in different +layers, and we animate by successively making visible then hiding each of the +layers in turn. The same can be done with buttons. Buttons can take on +appearances using what I'll call icons. We create a series of stacked +buttons, each with an icon appearance; when the animation is started, each +button becomes visible and hidden in turn. + +\exAeBBlogPDF{p=382} The demo file for the material in this section, +(and for the support material in `\mlnameref{sss:btnAnimeMethods}' on +page~\pageref*{sss:btnAnimeMethods}) is titled \textsl{\cs{btnAnime}: +Animation using Form Field Buttons with {\AEBP}} can be found at the +\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site. + +To create a button anima, follow these steps: +\begin{enumerate} + \item Create your animation by placing one frame of your animation on + one page of a PDF. If the anime has 40 frames, the PDF has 40 pages, + each page contains one frame. The anime must be placed on the page + exactly in the same place to avoid any noticeable shaking or trembling + of the anime as it plays. (I use PSTricks to create a few of the demo + animations.) Give your animation PDF some name, say, \texttt{myAnime.pdf} + + \item In the preamble, place the following commands +\begin{Verbatim}[xleftmargin=\amtIndent] +\embedMultiPageImages{lastpage=36,name=myAnime, + path=graphics/myAnime.pdf,placement=myFirstAnime} +\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myFirstAnime} +\begin{docassembly} +\insertPreDocAssembly; +\executeSave(); +\end{docassembly} +\end{Verbatim} +The commands \cs{embedMultiPageImages} and \cs{placeAnimeCtrlBtnFaces} are +described in detail in \Nameref{sss:btnAnimeMethods}. These commands embed +the icons (or graphic images) in the PDF document, and associates them with +the anime being created. + +\item Use the \cs{btnAnime} command to create your animation. +\cs{btnAnime} is described below, for now, we present an example. +\begin{Verbatim}[xleftmargin=\amtIndent] +\btnAnime{% + fieldName=myFirstAnime,iconName=myAnime,nFrames=36, + controls=skin3,nospeedcontrol,type=loop, + autorun,autopause +}{72bp}{72bp} +\end{Verbatim} +\end{enumerate} + +The centerpiece of button anime is the \cs{btnAnime} command, which is the +one that actually creates the button fields to display the animation, and +the button to control the anime. + +\settowidth{\aebdimen}{\ttfamily\string\btnAnime\darg{\meta{KV-pairs}}\darg{\meta{width}}\darg{\meta{height}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\btnAnime{!meta(KV-pairs)}{!meta(width)}{!meta(height)} +\end{dCmd} +\CmdDescription Create a series of stacked buttons that hold and display +the frames of the animation; it also creates the control buttons. + +\PD The first parameter,\footnote{In version~1.1 (dated 07/10/10) the +first parameter was optional, since there are required keys in this +parameter, I've changed this first parameter to required.} taking +key-value pairs, is describe below, the \meta{width} and +\meta{height} parameters are the width and height of the button fields +to display the animation. These buttons are all the same size and stacked +one on top the other. + +\KVP The first optional parameter takes key-value pairs (\meta{KV-pairs}). +\begin{itemize} + \item \texttt{fieldName}: The base name of the anime fields to be + created. The key \texttt{fieldName} corresponds to the + \texttt{placement} key of \cs{embedMultiPageImages}. + \item \texttt{iconName}: The base name of the icon set to be used in + this anime. The \texttt{iconName} key corresponds to the \texttt{name} key + of \cs{embedMultiPageImages}. + \item \texttt{nFrames}: The number of frames in this anime; must be + the same number as \texttt{lastpage-firstpage+1} as declared in + \cs{embedMultiPageImages}. (If the \texttt{first\-page} key is not used, then + \texttt{nFrames=lastpage}.) + \item \texttt{type}: This is a choice key that takes any of three values: \texttt{loop}, + \texttt{palindrome}, or \texttt{stopatboundary}. The latter being the + default. For \texttt{loop}, the goes through the stack of frames from + 1 to \texttt{nFrames}, then repeats 1 to \texttt{nFrames}, and so on + until the anime is paused. For \texttt{palindrome}, the anime plays in + the order 1 to \texttt{nFrames}, \texttt{nFrames}-1 to 1, then + repeat. This anime continues until the paused. For + \texttt{stopatboundary}, the anima pauses when the frame reaches + \texttt{nFrames} for forward play, and pauses at frame 1 for + backward play. + \item \texttt{poster}: This is a choice key that takes any of three values: \texttt{first}, + \texttt{last}, and \texttt{none}; the default is \texttt{first}. + \item \texttt{speed}: When the anime is played, the value of speed is + the \texttt{initial} or \texttt{default} speed of the animation. + The speed is measured in \emph{milliseconds}. + There are controls for changing the speed dynamically. When the speed + key is not listed, the default speed is 200 milliseconds. + \item \texttt{autorun}: Determines whether the anime plays when + the page is either open or becomes visible; see \texttt{autoplayevent} + below. The default is \texttt{autorun=false}. Listing \texttt{autorun} in the + list of options is the same as \texttt{autorun=true}. + \item \texttt{autopause}: Determines whether the anime pauses when + the page is either closed or becomes invisible; see \texttt{autopauseevent} + below for more detail. The default is \texttt{autopause=false}. Listing \texttt{autopause} in the + list of options is the same as \texttt{autopause=true}. + \item \texttt{autoplayevent}: This is a choice key that takes one of two values: + \texttt{pageopen} or \texttt{pagevisible}. The distinction between + these two only becomes significant when the user is viewing pages + continuously. The default is \texttt{pageopen}. + \item \texttt{autopauseevent}: This is a choice key that takes one of two values: + \texttt{pageclose} or \texttt{pageinvisible}. The distinction between + these two only becomes significant when the user is viewing pages + continuously. The default is \texttt{pageclose}. +\end{itemize} +The following keys concerning the buttons that control the anime. +\begin{itemize} + \item \texttt{ctrlwidth}: The common width of the various control + buttons, the default is \texttt{18bp}. + \item \texttt{ctrlheight}: The common height of the various control + buttons, the default is \texttt{9bp}. +\end{itemize} +\textbf{Note:} The next two keys \texttt{ctrlbdrycolor} and +\texttt{ctrlbdrycolor}, are needed to get the space between the buttons +and the space between the rows correct. These two parameters, under +different names, can be set through \cs{btnAnimeCtrlPresets}, but it is +not recommended that you use this command to set the border color or size, use +the following two keys are part of the key-value list. +\begin{itemize} + \item \texttt{ctrlbdrycolor}: Three numbers representing color in the + RGB space. This color is used as the color of the boundary line for + the button. The default color is transparent, obtained by simply + listing \texttt{ctrlbdrycolor} with no value. + \item \texttt{ctrlbdrywidth}: A choice key determining the width + of the boundary line (or stroke). The choices are + \texttt{thin}, \texttt{medium}, and \texttt{thick}, and correspond + to a boundary line of width \texttt{1bp}, \texttt{2bp}, and \texttt{3bp}, respectively. + The default is \texttt{thin} (\texttt{1bp}). + \item \texttt{controls}: Determines the design of the set of + control buttons. The following values are recognized: + \texttt{none}, \texttt{skin1}, \texttt{skin2}, \texttt{skin3}, + \texttt{skin4}, \texttt{skin5}, \texttt{skin6}. When + \texttt{controls=none}, no controls are displayed (better use + \texttt{autoplay}/\texttt{autopause}); skins 1--4 have various + buttons included in them, \texttt{skin1} includes all buttons. + + \item[] Values of \texttt{skin5} and \texttt{skin6} are left for the + author to design his/her own button layout. Without a redefinition, + these skins opt to \texttt{skin1}. See the appropriate section of + \texttt{aeb\_pro.dtx} to see who one might create a custom layout. + + \item[] The space between control buttons is determined by + \cs{btnanimebtnsep}, the default definition is + \verb!\newcommand{\btnanimebtnsep}{1bp}!. + + \item[] \cs{aep@vspacectrlsep}: The vertical space between the + bottom of the anime and the control button set, + \verb!\newcommand{\aep@vspacectrlsep}{3bp}! is the default + definition. + + \item \texttt{nospeedcontrol}: There are two buttons for increasing + and decreasing the speed. (The minimal speed is 10 milliseconds, by the + way.) If \texttt{nospeedcontrols} are included in the option list, + then this Plus/Minus pair of buttons are not included in the set of + control buttons. + \item \texttt{usetworows}: If \texttt{usetworows} is in the option + list, then two rows are taken to list all the buttons. The second row + usually consists of the Plus/Minus buttons. + + \item[] The vertical space between two rows of buttons is + \cs{btnanimerowsep}, the default definition is + \verb~\newcommand{\btnanimerowsep}{1bp}~. +\end{itemize} + +\paragraph*{Controlling the appearance of the Anime Fields.} +You can influence of the appearance of buttons that display the images by +using the command \cs{btnAnimePresets}. +\settowidth{\aebdimen}{\ttfamily\string\btnAnimePresets\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\btnAnimePresets{!meta(KV-pairs)} +\end{dCmd} +\PD The key values are ones associated with button form fields, as +described in the eForm reference. + +\paragraph*{Controlling the appearance of the Anime Control Buttons.} +You can influence of the appearance of the buttons that provide the +control for the anime by using the command \cs{btnAnimeCtrlPresets}. +\settowidth{\aebdimen}{\ttfamily\string\btnAnimeCtrlPresets\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\btnAnimeCtrlPresets{!meta(KV-pairs)} +\end{dCmd} +\PD The key values are ones associated with button form fields, as +described in the eForm reference. + +\subsection{The \protect\texttt{ocgAnime} Environment}\label{ss:ocganime} + +{\cAEBP} has provided for several years a basic animation feature using +layers (or, in Adobe's terminology, OCG, optional content groups). We +now upgrade OCG animation up to the same level as button anime, much of +the same code is used. Code for OCG anime is include when the \texttt{ocganime} +option is taken. + +\exAeBBlogPDF{p=392} The demo file for the material in this section, +is titled \textsl{\texttt{ocgAnime}: Animation using OCG (Layers) with \AEBP} can be found at the +\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site. + +\newtopic OCG animation is available through the \texttt{ocgAnime} +environment. + +\bgroup\obeyspaces% +\settowidth{\aebdimen}{\ttfamily \anglemeta{a set of ocg frames built using \string\animeBld/\string\eBld pairs}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\begin{ocgAnime}{!meta(KV-pairs)} + !anglemeta(a set of ocg frames built using \animeBld/\eBld pairs) +\end{ocgAnime} +\end{dCmd} +\egroup\KVP The key-value pairs are the same ones described in +\hyperref[ss:btnanime]{Section~\ref*{ss:btnanime}} on +page~\pageref*{ss:btnanime}. The \texttt{iconName} key is not recognized +(this is a button anime key), and \texttt{ocg\-Ani\-me\-Name} is an alias for +\texttt{fieldName}, \texttt{ocgAnimeName} being more descriptive of the +base name for the OCG animation. The two keys \texttt{ocgAnimeName} and +\texttt{nFrames} are required. + + +Below is an example of this syntax. + +\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont] +\begin{ocgAnime}{ocgAnimeName=sineAnime,nFrames=41, + type=palindrome,speed=10,controls=skin1} +\FPdiv{\myDelta}{\psPiTwo}{40} +\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld} +\def\xi{0}\psset{algebraic=true} +\psset{llx =-12pt,lly=-12pt,urx =12pt,ury =12pt} +\begin{psgraph*}[arrows=->,trigLabels=true,trigLabelBase=2, + dx=\psPiH](0,0)(-.5,-1.5)(6.75,1.5){164pt}{70pt}% + \rput(4,1){$y=\sin(x)$}% + \animeBld\eBld + \multido{\i=1+1}{40}{\FPadd{\xi}{\xi}{\myDelta}\thisframe}% +\end{psgraph*} +\end{ocgAnime} +\end{Verbatim} +As with \cs{btnAnime}, \cs{placeAnimeCtrlBtnFaces} is used to import the +icon appearances of the control buttons. + +\subsection{Moving the Control Buttons} + +The default location of the control buttons is below the anime. It is +possible to move them elsewhere. Use the commands \cs{animeSetup} and +\cs{insertCtrlButtons} for this purpose. + +\exAeBBlogPDF{p=400} The demo file for the material in this section, +is titled \textsl{Moving the Control Buttons for Button and OCG Animation} can be found at the +\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site. + +\settowidth{\aebdimen}{\ttfamily\string\animeSetup\darg{\meta{KV-pairs}}}% +\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule} +\animeSetup{!meta(KV-pairs)} +\end{dCmd} +\CmdDescription The argument is the key-value pairs of \cs{btnAnime} or +of the \texttt{ocgAnime} environment. The command processes the key-value +pairs. + +Following the execution of \cs{animeSetup}, use \cs{insertCtrlButtons} to +layout the buttons according to the values specified by the key-value +pairs. An example follows. + +\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont] +\begin{minipage}[c]{190pt}\centering +\begin{ocgAnime}{ocgAnimeName=sineAnime,nFrames=41, + type=palindrome,speed=10,controls=none} +\FPdiv{\myDelta}{\psPiTwo}{40} +\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld} +\def\xi{0}\psset{algebraic=true} +\psset{llx =-12pt,lly=0pt,urx=12pt,ury=12pt} +\begin{psgraph*}[arrows=->,trigLabels=true,trigLabelBase=2, + dx=\psPiH](0,0)(-.5,-1.5)(6.75,1.5){164pt}{70pt}% + \rput(4,1){$y=\sin(x)$}\animeBld\eBld % first (empty) frame + \multido{\i=1+1}{40}{\FPadd{\xi}{\xi}{\myDelta}\thisframe}% +\end{psgraph*} +\end{ocgAnime} +\end{minipage}\quad{\animeSetup{ocgAnimeName=sineAnime,nFrames=41, + type=palindrome,speed=10,controls=skin3,usetworows}% + \insertCtrlButtons} +\end{Verbatim} +\textbf{Comments:} The key-value pairs passed in line~(2) are minimal, +with \texttt{controls=none}. After closing the \texttt{minipage} +environment in line~(14), we begin with a left-brace (\verb!{!) to enclose +\cs{animeSetup} and \cs{insertCtrlButtons} in a group so all changes in +the parameters are local. In lines~(13)--(16), we execute \cs{animeSetup} with our +selected options, and follow this with \cs{insertCtrlButtons} and we are +done! + +\cs{insertCtrlButtons} itself expands to a \cs{parbox}, +\cs{insertCtrlButtons} has an optional parameter that is passed to the +optional parameter of the underlying \cs{parbox}, permissible values are +\texttt{c} (the default), \texttt{b}, and \texttt{t}. + +Note that if you want to use \texttt{autorun} and \texttt{autoresume}, +these parameters must be passed in the parameter set of \texttt{ocgAnime}, +not from the parameter set of \cs{animeSetup} + +Rather just enclosing \cs{animeSetup} and \cs{insertCtrlButtons} in +grouping braces, you could also use a \cs{parbox}, and add, perhaps, a +caption. + +In theory, the control button can be placed anywhere on the page, above +the anime, below it, to the left or to the right of it. + +\exAeBBlogPDF{p=405} The \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} post +titled \textsl{Custom Designing Anime Control Button Layout} shows how to +design your own button layout, and how to define your own ``skin.'' + + +One last command, \cs{insertCtrlButtons} is normally expanded at the end +of the \cs{btnAnime} or \texttt{ocgAnime} environments. It appears in the +form +\begin{Verbatim} + \ctrlButtonsWrapper{\insertCtrlButtons} +\end{Verbatim} +\exAeBBlogPDF{p=418} The command \cs{ctrlButtonsWrapper} can be redefined to create special +effects, as illustrated in the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} post titled \textsl{Some Comments on Anime Button +Layouts}. + + +\newpage +\markright{References} + +\parskip0pt +\begin{thebibliography}{[1]} %\label{references} +\addcontentsline{toc}{section}{\protect\numberline{}References} +\backrefparscanfalse +\def\srtln{\vskip-\baselineskip\vskip-\parsep} +\def\lngln{\vskip-\parsep} + + +\bibitem{TUG:execJS} ``\texttt{execJS}: A new technique for introducing discardable + JavaScript into a PDF from a \LaTeX{} source,'' TUGBoat, The + Communications of the \TeX{} User Group, Vol.~22, No.~4, pp.\ + 265-268 (2001). \backrefprint + +\bibitem{tech:AcroJSRef} + JavaScript for Acrobat® API Reference, Adobe® Acrobat® SDK, Version~8.0., + Adobe Systems, Inc., 2006. \backrefprint + \lngln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}} + +\bibitem{tech:AcroJSGuide} + Developing Acrobat® Applications Using JavaScript, Version~8.0., + Adobe Systems, Inc., 2006. \backrefprint + \srtln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}} + +\bibitem{tech:pdfmark} + pdfmark Reference Manual, Version~8.0, Adobe® Acrobat® SDK, Version~8.0, 2006. \backrefprint + \srtln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}} + + +\bibitem{tech:PDFRef} + PDF Reference, Version~1.7., Adobe Systems, Inc., 2006. \backrefprint + \lngln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}} + +\bibitem{book:AEBB} + D. P. Story, \textsl{\AEBBook}, in preparation. \backrefprint + + +\end{thebibliography} + + +\noindent +Now, I simply must get back to my retirement. \dps + +%\newpage +%\leftskip20pt\rightskip20pt\small +%\addcontentsline{toc}{section}{\protect\numberline{}Index} +%\markright{Index} +%\printindex + +\end{document} + +\section{Resources} + +\newtopic The resources for the development of this package are +\begin{itemize} +% \item \textsl{Standard ECMA-357: ECMAScript for XML (E4X) Specification},\\ +% \url{http://www.ecma-international.org/publications/standards/Ecma-357.htm} +% \item \textsl{XMP Specification}, \url{http://www.adobe.com/go/acrobat_developer} + \item \textsl{Acrobat JavaScript Scripting Reference}, Version 8.0\\ + \url{http://www.adobe.com/go/acrobat_developer} +% \item \textsf{hyperxmp} package by Scott Pakin.\\ +% \url{ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperxmp/} +% \item The {\AcroTeX} System Tools, available for free download at \url{www.acrotex.net}. This is +% a {\LaTeX}-based system. +\end{itemize} + +After you download the zip file (available in +http://www.math.uakron.edu/~dpstory/aeb_pro/aebpro_pack.zip), expand it by +double-clicking on it. + +Place the folder inside ~/Library/texmf/tex/latex (here ~ is your home +directory; inside there is a folder called Library; if necessary, create a +folder named tex inside it, and then a folder called latex inside that; + +NOTE: if you are using Mac OS X 10.7 (Lion), the Library folder is hidden +by default - to open it, hold down the option key and click on the "Go" +menu in the Finder to make it appear). + +Also, check the pdf manual that comes with the software. + +Luis Sequeira + +> P.S. I use TexLive, I have Acrobat Professional and Distiller. How is possible to have the workflow you said me (Latex-->dvi-->distiller-->pdf) with TexShop? XeLateX is right? + +The easiest way to have the required workflow in TeXShop is to add a special comment line at the top of your file (it is a comment as far as TeX is concerned, beginning with the comment character '%' ; but TeXShop looks at the first lines of the source file for this and other similar information and calls the appropriate commands accordingly): + +%! TEX TS-program = latex + + +Similarly, you can replace 'latex' with 'pdflatex' or 'xelatex' to get your source automatically typeset with a different engine. + +As to using XeLaTeX, if you want to use it in documents containing pstricks stuff, you'll need to use the package auto-pst-pdf: + +\usepackage{auto-pst-pdf} + + +Note: TeXShop is an excellent front-end to all things TeX-related. Since it is Mac-only, you may get more help more quickly for things specific to TeXShop in the Mac OS X TeX mailing list. diff --git a/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.eps b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.eps Binary files differnew file mode 100644 index 00000000..36322513 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.eps diff --git a/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf Binary files differnew file mode 100644 index 00000000..c41d81c4 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf Binary files differnew file mode 100644 index 00000000..e27e574d --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf Binary files differnew file mode 100644 index 00000000..63ccd7e4 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf Binary files differnew file mode 100644 index 00000000..a059d308 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf Binary files differnew file mode 100644 index 00000000..44f415a8 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/aest.xls b/texmf-dist/source/latex/aeb-pro/extras/aest.xls Binary files differnew file mode 100644 index 00000000..55e0bcd5 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/aest.xls diff --git a/texmf-dist/source/latex/aeb-pro/extras/ease.pdf b/texmf-dist/source/latex/aeb-pro/extras/ease.pdf Binary files differnew file mode 100644 index 00000000..20c8a637 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/ease.pdf diff --git a/texmf-dist/source/latex/aeb-pro/extras/trek.wav b/texmf-dist/source/latex/aeb-pro/extras/trek.wav Binary files differnew file mode 100644 index 00000000..b8d9e65d --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/extras/trek.wav diff --git a/texmf-dist/source/latex/aeb-pro/fsprodef.js b/texmf-dist/source/latex/aeb-pro/fsprodef.js new file mode 100644 index 00000000..ce8ff605 --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/fsprodef.js @@ -0,0 +1,64 @@ +%% +%% This is file `fsprodef.js', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% aeb_pro.dtx (with options: `copyright,fsdefjs') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aeb_pro.sty package, 2016-05-15 %% +%% Copyright (C) 2006--2016 D. P. Story %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{insDLJS}[_fsDefaults]{fsdef}{AeB Pro: Presentation Defaults} +var _fsDefaults = true; +if ( typeof fsexec == "undefined" ) +{ + try { + var fsexec = true; + var aebdefaultTransition = app.fs.defaultTransition; + var aebbackgroundColor = app.fs.backgroundColor; + var aebloop = app.fs.loop; + var aebtimeDelay = app.fs.timeDelay; + var aebuseTimer = app.fs.useTimer + var aebusePageTiming = app.fs.usePageTiming; + var aebclickAdvances = app.fs.clickAdvances; + var aebcursor = app.fs.cursor; + var aebescapeExits = app.fs.escapeExits; +\aeb@fsTran% +\aeb@fsBGColor% +\aeb@fsLoop% +\aeb@fsclickAdv% +\aeb@fscursor% +\aeb@fstimeDelay% +\aeb@fsuseTimer% +\aeb@fsusePageTiming% +\aeb@fsEscape% +\aeb@fsFS% + } catch(e) {} +} +\end{insDLJS} +\begin{fs@willClose} +try { + delete global.fsexec; + app.fs.defaultTransition = aebdefaultTransition; + app.fs.backgroundColor = aebbackgroundColor; + app.fs.loop = aebloop; + app.fs.timeDelay = aebtimeDelay; + app.fs.useTimer = aebuseTimer; + app.fs.usePageTiming = aebusePageTiming; + app.fs.clickAdvances = aebclickAdvances; + app.fs.cursor = aebcursor; + app.fs.escapeExits = aebescapeExits; +} catch(e) { console.println("Could not reset one of the defaults"); } +\end{fs@willClose} +\endinput +%% +%% End of file `fsprodef.js'. diff --git a/texmf-dist/source/latex/aeb-pro/icons/btn_anime_icons1.pdf b/texmf-dist/source/latex/aeb-pro/icons/btn_anime_icons1.pdf Binary files differnew file mode 100644 index 00000000..7bb4e30c --- /dev/null +++ b/texmf-dist/source/latex/aeb-pro/icons/btn_anime_icons1.pdf diff --git a/texmf-dist/source/latex/aebxmp/aebxmp.dtx b/texmf-dist/source/latex/aebxmp/aebxmp.dtx new file mode 100644 index 00000000..35f46a5a --- /dev/null +++ b/texmf-dist/source/latex/aebxmp/aebxmp.dtx @@ -0,0 +1,812 @@ +%\iffalse +% makeindex -s gglo.ist -o web.gls web.glo +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% aebxmp.sty package, 2016-05-29 %% +%% Copyright (C) 2006--2016 D. P. Story %% +%% dpstory@uakron.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of %% +%% the License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%<package>\ProvidesPackage{aebxmp} +%<package> [2017/02/17 v2.5a Populate advanced metadata (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{aebxmp}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{aebxmp}{aebdocfmt.def cannot be found}} +\begin{document} +\def\CMD#1{\textbackslash#1} + \GetFileInfo{aebxmp.sty} + \title{AeBXMP: Updating XMP using E4X and {\LaTeX}} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \DocInput{aebxmp.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute + \texttt{makeindex -s gind.ist -o aebxmp.ind aebxmp.idx} on the command line and recompile + \texttt{aebxmp.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute + \texttt{makeindex -s gglo.ist -o aebxmp.gls aebxmp.glo} on the command line and recompile + \texttt{aebxmp.dtx}.} +\end{document} +%</driver> +% \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{aebxmp}{Inputting aebdonotindex.def}} +% {\PackageInfo{aebxmp}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% \changes{v2.5}{2016/05/20}{Moved DJLS from \string\texttt{addScript} in \string\texttt{insDLJS} env.} +% \changes{v2.3c}{2012/09/20}{Changed \cs{copyrightNotice} and a +% added \cs{Title} and \cs{Subject}, and . These now accept multiple entries with a required +% language specification.Also defined the JavaScript arrays \texttt{aTitle}, \texttt{aSubject} +% \texttt{aRights}. Added \cs{sourceFile} to save the name of the source file in the +% DC packet. Added \cs{metaLang}, also to the DC packet.} +% \changes{v2.3a}{2012/01/12}{Set the \texttt{lang} attribute to a value of \texttt{x-default} +% for \cs{copyrightNotice}. Added a choice key to \cs{copyrightStatus} to force an +% acceptable argument.} +% \changes{v2.3}{2012/01/09}{All XMP elements now is inserted by E4X.} +% \changes{v2.2}{2012/01/04}{Added the \cs{Keywords} command for creating an array +% of keywords that can be accessed individually using the JavaScript function +% \texttt{aKeyWords}, also defined in this package.} +% \changes{v2.1a}{2011/12/30}{More code efficiencies} +% \changes{v2.1}{2011/12/30}{Cleaned up the code, fixed a bug.} +% \changes{v2.0}{2011/12/30}{Defined commands to producing custom document properties, +% defined the \cs{Authors} command.} +% \changes{v1.0}{2011/12/29}{Made a proper DTX file for this package; added +% \cs{authortitle} and \cs{descriptionwriter}; support for \texttt{xmp:CreateDate}.} +% \changes{v0.2}{2007/03/13}{Added support for unicode escape sequences in the +% \cs{copyrightNotice} and \cs{copyrightInfoURL} fields.} +% \changes{v0.1}{2006/12/01}{Original distribution} +% \begin{macrocode} +\RequirePackage{xkeyval} +\@ifpackageloaded{insdljs}{\let\execjs=y} +% \end{macrocode} +% (2017/02/17) Require 2016/07/31 for insdljs to make colon syntax available. +% \changes{v2.5a}{2017/02/17}{Require 2016/07/31 for insdljs} +% \begin{macrocode} + {\RequirePackage[execJS]{insdljs}[2016/07/31]} % incls conv-xkv +% \end{macrocode} +% \section{Utility commands and switches} +% \begin{macrocode} +\newif\if@xmp@several \@xmp@severaltrue +% \end{macrocode} +% The following is a utility command used in \cs{copyrightStatus}, \cs{Title}, +% and \cs{Subject}. +% \begin{macrocode} +\def\xmp@testBrace#1{\@ifnextchar\bgroup + {\@xmp@severaltrue#1}{\@xmp@severalfalse#1}} +% \end{macrocode} +% \cs{xmpLangAndArg} is used by the same commands listed above. These are the ones +% that have a language attribute. +% \begin{macrocode} +\newcommand{\xmpLangAndArg}[1][]{%x-default + \edef\xmpLang{#1}\xmpGetNextArg} +\def\xmpGetNextArg#1\@nil{\edef\xmpArg{#1}} +% \end{macrocode} +% A major utility command used by \cs{copyrightStatus}, \cs{Title}, +% and \cs{Subject}. \texttt{\#1} is the arguments of the calling command, +% and \texttt{\#2} is the ``array'' macro. +% \begin{macrocode} +\edef\xmp@dquoteCat{\the\catcode`\"} +\catcode`\"=12\relax +\def\xmp@ProcessArgs#1#2{% + \if@xmp@several + \@tfor\xmpArg:=#1\do{% + \expandafter\xmpLangAndArg\xmpArg\@nil + \ifnum\count0=0\relax + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="x-default";}% + \ifx\xmpLang\@empty\else + \advance\count0by1\relax + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \else + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \advance\count0by1\relax + }% + \else + \@tfor\xmpArg:={#1}\do{% + \expandafter\xmpLangAndArg\xmpArg\@nil + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="x-default";}% + \ifx\xmpLang\@empty\else + \advance\count0by1 + \xdef#2{#2^^J% + \xmp@insItem[\the\count0]="\xmpArg";^^J% + \xmp@insItem[\the\count0].@xml::lang="\xmpLang";}% + \fi + \advance\count0by1\relax + }% + \fi +} +\bgroup\obeyspaces +\gdef\tabiv{ }% +\egroup +% \end{macrocode} +% +% \section{Top-level Interface to Metadata} +% Through this package, the author can specify certain ``Advanced Metadata'' +% items: copyright notice; copyright notice; copyright url; author title; +% and writer description. +% +% \subsection{Dublin Core Properties} +% +% \begin{macro}{\copyrightNotice} +% The argument \texttt{\#1} is the text of the \textsf{Copyright Notice}, +% multiple languages supported. The first copyright notice is also tagged +% as the default, \texttt{x-default}. +%\begin{verbatim} +%\copyrightNotice{% +% {[lang_1] Copyright notice} +% {[lang_2] Copyright notice} +% ... +%} +%\end{verbatim} +% \begin{macrocode} +\let\arrayOfRights\@empty +\newcommand{\copyrightNotice}[1]{\def\xmpcopyrightNotice{#1}% + \xmp@testBrace{\xmp@cont@CopyRightNotice}#1\@nil}% +\let\xmpcopyrightNotice\@empty +% \end{macrocode} +% \cs{copyrightNotice} continues with \cs{xmp@cont@CopyRightNotice} +% \begin{macrocode} +\def\xmp@cont@CopyRightNotice#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::rights.aebrdf::Alt.aebrdf::li}% + \ifx\xmpcopyrightNotice\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfRights}% + \fi + \endgroup +} +% \end{macrocode} +% \begin{macro}{\Authors} +% Enter multiple authors using a token list +%\begin{verbatim} +%\Authors +%{% +% {D. P. Story} +% {A. P. Story} +% ... +%} +%\end{verbatim} +% We use \cs{@tfor} to build an array of authors, and use the simple mechanism +% of \texttt{this.info.Authors} to set the multiple authors. +% \begin{macrocode} +\let\arrayOfAuthors\@empty +\let\xmpAuthors\@empty +\newcommand{\Authors}[1]{\def\xmpAuthors{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insSeqItem{p.aebdc::creator.aebrdf::Seq.aebrdf::li}% + \ifx\xmpAuthors\@empty\else + \let\arrayOfAuthors\@gobble + \@tfor\xmpAuthor:=#1\do{% + \xdef\arrayOfAuthors{\arrayOfAuthors^^J% + \insSeqItem[\the\count0]="\xmpAuthor";}% + \advance\count0by1 + }% + \fi + \endgroup +} +\def\insertAuthors{\ifx\arrayOfAuthors\@empty\else + ^^J\arrayOfAuthors\fi} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\Title} +% Allow multiple Titles, with language specification; syntax +%\begin{verbatim} +%\Title{% +% {[lang_1] Title} +% {[lang_2] Title} +% ... +%} +%\end{verbatim} +% Begin \cs{Title} +% \begin{macrocode} +\let\arrayOfTitles\@empty +\newcommand{\Title}[1]{\edef\xmpTitle{#1}% + \xmp@testBrace{\xmp@cont@Title}#1\@nil} +% \end{macrocode} +% continuation of \cs{Title} +% \begin{macrocode} +\def\xmp@cont@Title#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::title.aebrdf::Alt.aebrdf::li}% + \ifx\xmpTitle\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfTitles}% + \fi + \endgroup +} +\def\insertTitles{\ifx\arrayOfTitles\@empty\else + ^^J\arrayOfTitles\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Subject} +% Allow multiple subjects, with language specification. +% Begin \cs{Subject} +% \begin{macrocode} +\let\arrayOfSubjects\@empty +\newcommand{\Subject}[1]{\edef\xmpSubject{#1}% + \xmp@testBrace{\xmp@cont@Subject}#1\@nil}% +% \end{macrocode} +% Continue \cs{Subject} +% \begin{macrocode} +\def\xmp@cont@Subject#1\@nil{% + \begingroup\let\u\relax\count0=0\relax + \def\xmp@insItem{p.aebdc::description.aebrdf::Alt.aebrdf::li}% + \ifx\xmpSubject\@empty\else + \xmp@ProcessArgs{#1}{\arrayOfSubjects}% + \fi + \endgroup +} +\def\insertSubjects{\ifx\arrayOfSubjects\@empty\else + ^^J\arrayOfSubjects\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\metaLang} +% A list of languages used in this document. +% \begin{macrocode} +\let\arrayOfLangs\@empty +\newcommand{\metaLang}[1]{\def\xmplangOfDoc{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insBagItem{p.aebdc::language.aebrdf::Bag.aebrdf::li}% + \ifx\xmpLangs\@empty\else + \let\arrayOfLangs\@gobble + \@for\xmpLang:=#1\do{% + \xdef\arrayOfLangs{\arrayOfLangs^^J% + \insBagItem[\the\count0]="\xmpLang";}% + \advance\count0by1 + }% + \fi + \endgroup +} +\def\insertLangs{\ifx\arrayOfLangs\@empty\else + ^^J\arrayOfLangs\fi} +% \end{macrocode} +% \end{macro} +% \DescribeMacro{\sourceFile} is used to insert the name of the source file +% in to the Dublin Core. By default \cs{jobname.tex} is used. If this command +% is not executed, \cs{jobname.tex} is used. If executed with +% an empty argument, no \texttt{dc:source} is not inserted at all. If executed +% with a nonempty argument, that argument is assumed to be a file name and is +% inserted as the value of the \texttt{dc:source}. +% \begin{macrocode} +\newcommand{\sourceFile}[1]{\let\xmp@bSourcefile=1 + \def\xmp@sourcefile{#1}} +\let\xmp@bSourcefile=0 +\let\xmp@sourcefile\@empty +\def\insertSource{% + \if\xmp@bSourcefile0 + ^^Jp.aebdc::source="\jobname.tex"\else + \ifx\xmp@sourcefile\@empty\else + ^^Jp.aebdc::source="\xmp@sourcefile"\fi\fi} +% \end{macrocode} +% \begin{macro}{\Keywords} +% We try to implement keywords in a manner similar to \cs{Authors}; that is, +% we want to reference each key word. The individual keywords are listed in +% \texttt{dc:subject}, in a \texttt{Bag}, an unordered array. +% \begin{macrocode} +\let\arrayOfKeywords\@empty +\let\aKeywords\@empty +\let\xmpKeywords\@empty +\newcommand{\Keywords}[1]{\def\xmpKeywords{#1}% + \begingroup\let\u\relax\count0=0\relax + \def\insBagItem{% + p.aebdc::subject.aebrdf::Bag.aebrdf::li}% + \ifx\xmpKeywords\@empty\else + \let\arrayOfKeywords\@gobble + \let\aKeywords\@gobbletwo + \@for\xmpKeyword:=#1\do{% + \xdef\arrayOfKeywords{\arrayOfKeywords^^J% + \insBagItem[\the\count0]="\xmpKeyword";}% + \xdef\aKeywords{\aKeywords;\space\xmpKeyword}% + \advance\count0by1 + }% + \xdef\aKeywords{"\aKeywords"}% + \fi + \endgroup +} +% \end{macrocode} +% \cs{insertKeywords} does what the other ``insert'' commands do, insert the +% code, we use the \texttt{dc:subject} tag, which corresponds to keywords. +% Used in the disposable code below. +% \begin{macrocode} +\def\insertKeywords{\ifx\arrayOfKeywords\@empty\else + ^^J\arrayOfKeywords\fi} +% \end{macrocode} +% \end{macro} +% We set the keywords using the JavaScript property \texttt{Doc.info}, rather +% than a pdfmark. We also optionally include document-level JS so the document +% user can access individual keywords. \DescribeMacro{\xmpDoNotInsKWScript}\cs{xmpDoNotInsKWScript} +% optionally turns off the insertion of the function \texttt{aKeywords()}. +% \begin{macrocode} +\let\xmpInsScript\@empty +\newcommand{\xmpDoNotInsKWScript}{\let\xmpInsScript\null} +% \end{macrocode} +%\subsection{XMP Rights Management Properties} +% \begin{macro}{\copyrightStatus} +%If \texttt{\#1} is \texttt{True}, the \textsf{Copyright Status} is set to +%\texttt{Copyrighted}; if \texttt{False}, \textsf{Copyright Status} is set +%to \textsf{Public Domain}. If left empty, the status is set to +%\textsf{Unknown}. +% \begin{macrocode} +\newcommand{\copyrightStatus}[1]{% + \setkeys{aebxmp}{copyrightstatus=#1}} +% \end{macrocode} +% We offer choices of \texttt{true}, \texttt{false}, or \texttt{unknown} (case insensitive) +% for the argument of \cs{copyrightStatus} +% \begin{macrocode} +\define@choicekey*+{aebxmp}{copyrightstatus}[\val\nr]% + {true,false,unknown}[unknown]{% + \ifcase\nr\relax + \def\xmpcopyrightStatus{True}\or + \def\xmpcopyrightStatus{False}\else + \let\xmpcopyrightStatus\@empty\fi +}{\PackageWarning{aebxmp}{% + Bad choice for \string\copyrightStatus,\MessageBreak + you entered '#1'.\MessageBreak + Permissible values are true, false, or unknown\MessageBreak + (or an empty argument). Setting status to 'unknown'.\MessageBreak + Try again,}} +\let\xmpcopyrightStatus\@empty +% \end{macrocode} +% \end{macro} +% \cs{insertMarked} inserts the copyright status and is used in the +% disposable code. It only if one has been declared. If none is declared, +% the copyright notice will be \texttt{Unknown}. +% \begin{macrocode} +\def\insertMarked{\ifx\xmpcopyrightStatus\@empty + \else^^Jp.aebxapRights::Marked="\xmpcopyrightStatus";\fi} +% \end{macrocode} +% \begin{macrocode} +\def\insertCopyrightNotice{\ifx\arrayOfRights\@empty\else + \arrayOfRights\fi} +% \end{macrocode} +% Insert copyright notice and specify the language attribute, which is +% \texttt{x-default}. Used in the disposable code below. +% \begin{macro}{\copyrightInfoURL} +% The argument \texttt{\#1} is the \textsf{URL} to the copyright information +% \begin{macrocode} +\newcommand{\copyrightInfoURL}[1]{\def\xmpcopyrightInfoURL{#1}} +\let\xmpcopyrightInfoURL\@empty +% \end{macrocode} +% Insert the web statement. Used in the disposable code below. +% \begin{macrocode} +\def\insertWebStatement{\ifx\xmpcopyrightInfoURL\@empty + \else^^Jp.aebxapRights::WebStatement="\xmpcopyrightInfoURL";\fi} +% \end{macrocode} +% \end{macro} +%\subsection{Acrobat Custom Properties} +% \begin{macro}{\customProperties} +%\begin{verbatim} +%\customProperties +%{ +% {name=dps,value=5} +% {name=jg,value=good} +% ... +%} +%\end{verbatim} +% \begin{macrocode} +\let\insertCusProps\@empty +\newcommand\customProperties[1]{\def\pdfx@cusProps{#1}% + \begingroup\let\u\relax + \@tfor\thisproperty:=#1\do{% + \edef\tmp@exp{\noexpand +% \end{macrocode} +% (2017/02/17) Values of \texttt{customProperties} can use the colon notation +% \changes{v2.5a}{2017/02/17}{Values of customProperties can use the colon notation} +% \begin{macrocode} + \cxkvsetkeys{pdfx@cusPropKV}{name,value,\thisproperty}}\tmp@exp + \xdef\insertCusProps{\insertCusProps^^J% +% \end{macrocode} +% We permit the use of \cs{u} the the value of the custom property, +% the name of the custom property should be a restricted XML name, basically +% \texttt{A-Z},\texttt{a-z}, and \texttt{0-9}. +% \begin{macrocode} + p.aebpdfx::\pdfx@KName="\pdfx@VValue";} + }% + \endgroup +} +% \end{macrocode} +% The \texttt{pdfx@cusPropKV} family has two keys, \texttt{name} and \texttt{value}. +% These keys are used in the command \cs{customProperties} defined above. +% \begin{macrocode} +\define@key{pdfx@cusPropKV}{name}[]{\def\pdfx@KName{#1}} +\define@key{pdfx@cusPropKV}{value}[]{\def\pdfx@VValue{#1}} +% \end{macrocode} +% \end{macro} +% We define a simple tabbing command \cs{tabiv} to use within the JavaScript. +% +% \subsection{XMP Core Properties} +% These are some helper macros that conditionally fill in metadata when it exists. +% All these commands are used internally; the document author has no reason to use them. +% \changes{v2.5}{2016/05/20}{Added the \string\texttt{ModifyDate} property} +% \begin{macrocode} +\def\insertCreateDate{^^Jp.@aebxap::CreateDate=createDateStr;% +^^Jp.@aebxap::ModifyDate=createDateStr;} +\def\xmpnEOL{\string\n\string\^^J} +% \end{macrocode} +% \subsection{Adobe Photoshop Properties} +% \begin{macro}{\authortitle} +% The \texttt{<text>} (argument \texttt{\#1}) appears in the +% \textsf{Author Title} line on the \textsf{Advanced Metadata} dialog box. +% This is a \textbf{Photoshop} property. (See the Advanced category in the left +% panel.) +% \begin{macrocode} +\newcommand{\authortitle}[1]{\def\xmpauthortitle{#1}} +% \end{macrocode} +% \DescribeMacro{\authorTitle} is an alias for \cs{authortitle}. +% \begin{macrocode} +\let\authorTitle\authortitle +\let\xmpauthortitle\@empty +% \end{macrocode} +% Insert the author title. Used in the disposable code below. +% \begin{macrocode} +\def\insertAuthorTitle{\ifx\xmpauthortitle\@empty + \else^^Jp.aebphotoshop::AuthorsPosition="\xmpauthortitle";\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\descriptionwriter} +% The \texttt{<text>} (argument \texttt{\#1}) appears in the +%\textsf{Description Writer} line on the \textsf{Advanced Metadata} dialog box. +%This is a \textbf{Photoshop} property. (See the Advanced category in the left +%panel.) +% \begin{macrocode} +\newcommand{\descriptionwriter}[1]{\def\xmpdescriptionwriter{#1}} +% \end{macrocode} +% \DescribeMacro{\descriptionWriter} is an alias for \cs{descriptionwriter}. +% \begin{macrocode} +\let\descriptionWriter\descriptionwriter +\let\xmpdescriptionwriter\@empty +% \end{macrocode} +% Insert the description writer. Used in the disposable code below. +% \begin{macrocode} +\def\insertDescriptionWriter{\ifx\xmpdescriptionwriter\@empty + \else^^Jp.aebphotoshop::CaptionWriter="\xmpdescriptionwriter";\fi} +% \end{macrocode} +% \end{macro} +% +% \section{Disposable JavaScript} +% Most of this package consists of a few new commands to populate the ``disposable'' +% JavaScript that is input as an \textsf{FDF} when the PDF file is first opened after distilling. +% This code does all the work. +% \par\medskip\noindent +% \cs{insertKWJS} expands to a JavaScript property assignment if there are \cs{aKeywords} +% is nonempty. +% \begin{macrocode} +\def\insertKWJS{\ifx\aKeywords\@empty\else + this.info.Keywords=\aKeywords;^^J\fi} +% \end{macrocode} +% When \textsf{pdflatex} is used (MiKTeX version), the package fails +% when \texttt{p.@xmlns::pdfx} is included. This seems to because the +% \textsf{pdflatex} version defines its own custom property. Haven't figured +% how to detect the presence of a custom property yet. +% \begin{macrocode} +%\edef\insertPDFX{\ifpdf\else p.@xmlns::pdfx=aebpdfx.uri;^^J\fi} +% \end{macrocode} +% Some namespace definitions +% \begin{macrocode} +\def\xNNS{new Namespace} +\def\xAdbNS{http://ns.adobe.com} +\def\xWiiiNS{http://www.w3.org} +\begin{execJS}{execXMP} +% \end{macrocode} +% Get the metadata from the current document. +% \begin{macrocode} +var meta=this.metadata; +var aebXMPData=new XML(meta); +% \end{macrocode} +% Define the needed namespaces +% \begin{macrocode} +var aebx=\xNNS("x","adobe:ns:meta/"); +var xmlns=\xNNS("xmlns","\xWiiiNS/2000/xmlns/"); +var xml=\xNNS("xml", "\xWiiiNS/XML/1998/namespace"); +var aebrdf=\xNNS("rdf","\xWiiiNS/1999/02/22-rdf-syntax-ns#"); +var aebdc=\xNNS("dc","http://purl.org/dc/elements/1.1/"); +var aebpdf=\xNNS("pdf","\xAdbNS/pdf/1.3/"); +var aebxap=\xNNS("xmp","\xAdbNS/xap/1.0/"); +var aebxapRights=\xNNS("xmpRights","\xAdbNS/xap/1.0/rights/"); +var aebphotoshop=\xNNS("photoshop","\xAdbNS/photoshop/1.0/"); +var aebpdfx=\xNNS("pdfx","\xAdbNS/pdfx/1.3/"); +% \end{macrocode} +% \begin{macrocode} +var p=aebXMPData.aebrdf::RDF.aebrdf::Description; +% \end{macrocode} +% The MiKTeX version of \textsf{pdflatex} places a custom property at the creation +% of the PDF. We detect whether any custom properties already exist, if they do, +% don't emit \texttt{p.@xmlns::pdfx=aebpdfx.uri}, otherwise, an exception it thrown +% when the metadata is updated at the end of this code. +% \begin{macrocode} +if ( p.@aebpdfx::*.toString() == "" ) p.@xmlns::pdfx=aebpdfx.uri; +p.@xmlns::photoshop=aebphotoshop.uri; +p.@xmlns::xmpRights=aebxapRights.uri; +% \end{macrocode} +% The creation date shall be the time this \textsf{FDF} is imported into the document. +% \begin{macrocode} +var d=new Date(); +var createDateStr=util.printd("yyyy-mm-ddTHH:MM:ss",d); +% \end{macrocode} +% We delete the element, in case it already has a value (unlikely), the we +% assign it our value. +% \begin{macrocode} +delete p.@aebdc::rights.aebrdf::Alt.aebrdf::li; +% \end{macrocode} +% \paragraph*{Dublin Core Properties +% (\texttt{dc}, \begin{NoHyper}\url{http://purl.org/dc/elements/1.1/}\end{NoHyper})}\strut\\ +% Core properties include \texttt{dc:format}, \texttt{dc:title}, +% \texttt{dc:rights}, \texttt{dc:creator}, and \texttt{dc:subject} (aka, keywords). +% Here, we set \texttt{dc:rights}, called \textsf{Copyright Notice} in the user interface. +% \begin{macrocode} +/* + Dublin Core Properties +*/% +\insertTitles% +\insertAuthors% +\insertSubjects% +\insertKeywords% +\insertLangs% +\insertSource% +\insertCopyrightNotice% + +% \end{macrocode} +% We delete all old values of \texttt{xapRights:Marked} and \texttt{xap:WebStatement}, +% and replace them with the new values. +% \begin{macrocode} +/* + XMP Rights Management Properties +*/ +delete p.@aebxapRights::Marked; +delete p.@aebxapRights::WebStatement;% +% \end{macrocode} +% Now we insert additional properties, if there are any +% \begin{macrocode} +% \end{macrocode} +% \paragraph*{XMP Rights Management}\strut\\(\texttt{xmpRights}, +% \begin{NoHyper}\url{http://ns.adobe.com/xap/1.0/rights/}\end{NoHyper})\\ +% These include \texttt{xmpRights:Marked} and \texttt{xmpRights:WebStatement}, both of which +% are set. +% \begin{macrocode} +\insertMarked% +\insertWebStatement% + +% \end{macrocode} +% \paragraph*{Adobe Photoshop Properties}\strut\\(\texttt{photoshop}, +% \begin{NoHyper}\url{http://ns.adobe.com/photoshop/1.0/}\end{NoHyper})\\ +% These include \texttt{photoshop:AuthorsPosition} and \texttt{photoshop:CaptionWriter}, both of which +% are set. +% \begin{macrocode} +delete p.@aebphotoshop::AuthorsPosition; +delete p.@aebphotoshop::CaptionWriter; +delete p.@aebxap::CreateDate; +/* + Adobe Photoshop Properties +*/% +\insertAuthorTitle% +\insertDescriptionWriter% + +% \end{macrocode} +% \paragraph*{Acrobat Custom Properties} (\texttt{pdfx}, +% \begin{NoHyper}\url{http://ns.adobe.com/pdfx/1.3/}\end{NoHyper})\\ +% Adobe allows the creation of custom properties that are accessible +% through the \texttt{Doc.info} object. +% \begin{macrocode} +/* + Acrobat Custom Properties +*/% +\insertCusProps% + +% \end{macrocode} +% \paragraph*{XMP Core Properties} (\texttt{xmp}, +% \begin{NoHyper}\url{http://ns.adobe.com/xap/1.0/}\end{NoHyper})\\ +% These properties include \texttt{xmp:CreatorTool}, +% \texttt{xmp:ModifyDate}, \texttt{xmp:CreateDate}, and \texttt{xmp:MetadataDate}. +% Here we set only \texttt{CreateDate}. +% \begin{macrocode} +/* + XMP Core Properties +*/% +\insertCreateDate% + +% \end{macrocode} +% Convert \texttt{aebXMPData} into a string +% \begin{macrocode} +/* + Convert aebXMPData into an XML String + and save is as this.metadata +*/ +var aebNewXMPStr=aebXMPData.toXMLString(); +% \end{macrocode} +% and assign it to the document metadata +% \begin{macrocode} +try { this.metadata=aebNewXMPStr; } + catch(e) {console.println(e.toString());} +% \end{macrocode} +% Insert a JavaScript assignment for keywords. +% \begin{macrocode} +\insertKWJS% +\end{execJS} +% \end{macrocode} +% +% \section{Document JavaScript} +% +% This definition environment defines four functions and four arrays. +% The functions are used to build the arrays. The arrays are user accessible, +% they are \texttt{aKeywords}, \texttt{aTitle}, \texttt{aSubject}, and \texttt{aRights}. +% \begin{macrocode} +\ifx\xmpInsScript\@empty +\begin{insDLJS}{xmpjs}{Access to Title, Subject, and Keywords} +function getKeywordsXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + return p.aebdc::subject.aebrdf::Bag.aebrdf::li[i]; +} +var i=0; +var aKeywords=new Array(); +while ( typeof getKeywordsXMP(i)!="undefined" ) { + aKeywords[i]=getKeywordsXMP(i).toString(); i++; +} +function getTitleXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="[" + p.aebdc::title.aebrdf::Alt.aebrdf::li[i].% +@xml::lang.toString()+"]: " + + p.aebdc::title.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aTitle=new Array(); +while ( getTitleXMP(i)!="undefined" ) { + aTitle[i]=getTitleXMP(i); i++; +} +function getSubjectXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="[" + p.aebdc::description.aebrdf::Alt.aebrdf::li[i].% +@xml::lang.toString()+"]: " + + p.aebdc::description.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aSubject=new Array(); +while ( getSubjectXMP(i)!="undefined" ) { + aSubject[i]=getSubjectXMP(i); i++; +} +function getRightsXMP(i) { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriDc="http://purl.org/dc/elements/1.1/"; + var uriXML="http://www.w3.org/XML/1998/namespace"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var aebrdf=new Namespace(uriRdf); + var aebdc=new Namespace(uriDc); + var xml=new Namespace("xml",uriXML); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + var retnStr; + try { retnStr="["+ p.aebdc::rights.aebrdf::Alt.aebrdf::li[i]% +.@xml::lang.toString()+"]: " + + p.aebdc::rights.aebrdf::Alt.aebrdf::li[i].toString(); + } catch(e) { retnStr="undefined" }; + return retnStr; +} +var i=0; +var aRights=new Array(); +while ( getRightsXMP(i)!="undefined" ) { + aRights[i]=getRightsXMP(i); i++; +} +function getCopyrightStatus() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriXAP="http://ns.adobe.com/xap/1.0/rights/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebxapRights=new Namespace("xmpRights",uriXAP); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::xmpRights=aebxapRights.uri; + var copyrightStatus = p.@aebxapRights::Marked; + if ( copyrightStatus=="True" ) + return "Copyrighted"; + else if ( copyrightStatus=="False" ) + return "Public Domain"; + else return "Unknown"; +} +function getCopyrightInfoURL() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriXAP="http://ns.adobe.com/xap/1.0/rights/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebxapRights=new Namespace("xmpRights",uriXAP); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::xmpRights=aebxapRights.uri; + var copyrightInfoURL=(p.@aebxapRights::WebStatement.toString()!="")? + (p.@aebxapRights::WebStatement):"Not provided"; + return copyrightInfoURL; +} +function getAuthorTitle() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriPhotoshop="http://ns.adobe.com/photoshop/1.0/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebPhotoshop=new Namespace("photoshop",uriPhotoshop); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::photoshop=aebPhotoshop.uri; + var authorTitle=(p.@aebPhotoshop::AuthorsPosition.toString()!="")? + (p.@aebPhotoshop::AuthorsPosition):"Not provided"; + return authorTitle; +} +function getDescriptionWriter() { + var uriRdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; + var uriPhotoshop="http://ns.adobe.com/photoshop/1.0/"; + var meta=this.metadata; + var aebXMPData=new XML(meta); + var xmlns=new Namespace("xmlns","http://www.w3.org/2000/xmlns/"); + var aebrdf=new Namespace(uriRdf); + var aebPhotoshop=new Namespace("photoshop",uriPhotoshop); + var p=aebXMPData.aebrdf::RDF.aebrdf::Description; + p.xmlns::photoshop=aebPhotoshop.uri; + var captionWriter=(p.@aebPhotoshop::CaptionWriter.toString()!="")? + (p.@aebPhotoshop::CaptionWriter):"Not provided"; + return captionWriter; +} +\end{insDLJS} +\fi +\catcode`\"=\xmp@dquoteCat +% \end{macrocode} +% \begin{macrocode} +%</package> +% \end{macrocode} +\endinput + +p.aebdc::description.aebrdf::Alt.aebrdf::li[0]="Euro \u20AC"; +p.aebdc::description.aebrdf::Alt.aebrdf::li[0].@xml::lang="x-default"; diff --git a/texmf-dist/source/latex/aebxmp/aebxmp.ins b/texmf-dist/source/latex/aebxmp/aebxmp.ins new file mode 100644 index 00000000..79ee0a18 --- /dev/null +++ b/texmf-dist/source/latex/aebxmp/aebxmp.ins @@ -0,0 +1,60 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 2006-2012 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2011/12/29} +\def\batchfile{aebxmp.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate +{% + \file{aebxmp.sty}{\from{aebxmp.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/texmf-dist/source/latex/aebxmp/doc/aebxmp_man.tex b/texmf-dist/source/latex/aebxmp/doc/aebxmp_man.tex new file mode 100644 index 00000000..8abc26b9 --- /dev/null +++ b/texmf-dist/source/latex/aebxmp/doc/aebxmp_man.tex @@ -0,0 +1,580 @@ +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv, + forcolorpaper,tight*,latextoc,pro}, + eforms,aebxmp +]{aeb_pro} +\usepackage{aeb_mlink} +\usepackage{graphicx,array} +%\usepackage{myriadpro} +%\usepackage[usecmtt]{myriadpro} +\usepackage[altbullet]{lucidbry} + +%\usepackage{makeidx} +%\makeindex +\usepackage{acroman} +\usepackage[active]{srcltx} + +\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$} +\def\meta#1{\textit{\texttt{#1}}} +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\pkg\textsf +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\let\uif\textsf + +\edef\amtIndent{\the\parindent} %\leftmargini +\def\SUB#1{${}_{\text{#1}}$} + +\newdimen\aebdimen \aebdimen\abovedisplayskip +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} + +\def\cmdtitle#1{\texorpdfstring{\protect\cs{#1}}{\textbackslash{#1}}} + +%\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom +%\screensize{6.5in}{5in} % height, width + +\university{\AcroTeX.Net} +\title{The aebXMP Package\texorpdfstring{\\[1em]}{: }Updating XMP using E4X and {\LaTeX}} +\author{D. P. Story} +\Authors{{D. P. Story}{J\u00FCrgen Gilg}} +\subject{Documentation of the AeBXMP Package} +\Keywords{XMP,E4X,Adobe Acrobat,JavaScript} +\email{dpstory@acrotex.net} +\version{2.5a, 2017/02/17} +\talksite{\url{www.acrotex.net}} +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=J\u00FCrgen Gilg} +} + +\DeclareInitView{windowoptions=showtitle} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\def\AcroTeX{Acro\negthinspace\TeX} + +\makeatletter +\@mparswitchfalse\reversemarginpar +\makeatother + +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.5em}} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\newcommand{\aebDescriptionlabel}[1]{% + \setlength\dimen@{\amtIndent+\labelsep}% + {\hspace*{\dimen@}#1}} +\makeatother +\newenvironment{aebDescript} + {\begin{list}{}{\setlength{\labelwidth}{0pt}% + \setlength{\leftmargin}{\leftmargin}% + \setlength{\leftmargin}{\leftmargin+\amtIndent}% + \setlength\itemindent{-\leftmargin}% + \let\makelabel\aebDescriptionlabel + }}{\end{list}} + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + + +\definePath\bgPath{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf"} +\begin{docassembly} +\addWatermarkFromFile({ + bOnTop:false, + cDIPath:\bgPath +}); +\executeSave(); +\end{docassembly} + + +\begin{document} + +\maketitle + +\changelinkcolorto{black} + +\tableofcontents + +\changelinkcolorto{webgreen} + + +\section{Introduction} + +The motivation for the development of this package came from +Herr~J\"{u}rgen Gilg, who had a need to fill in the metadata fields +beyond those normally populated by using \pkg{hyperref}: +\textsf{Title}, \textsf{Author}, \textsf{Subject} and +\textsf{Keywords}. Of particular interest to him were the metadata +fields \textsf{Copyright Status}, \textsf{Copyright Notice} and +\textsf{Copyright Info URL}. + +After doing some research on the CTAN archives, I came across the +\textsf{hyperxmp} package by Scott Pakin.\begin{NoHyper}\footnote{The reader is +invited to read the documentation of the \textsf{hyperxmp}, as +contained therein is a good discussion of XMP (eXtensible Metadata +Platform).}\end{NoHyper} The package works well with \textsf{pdftex} and +\textsf{dvipdfm}, but has a bit of a problem when using the +distiller. For this reason, I sought my own solution to the problem. + +As a beta tester of \app{Acrobat~8 Professional}, I had the opportunity to +use some of the new capabilities of the JavaScript interpreter as an +alternate approach to the one used by Mr.~Patkin. The JavaScript +version~1.6 interpreter, the one used in version 8, comes with E4X, +an XML parser, built in. I could see that E4X could be exploited to +manipulate the XMP data, and this was my approach. + +\section{Requirements} + +The techniques used by the \textsf{aebxmp} package to update the XMP data +require the \textcolor{blue}{{\AcroTeX} eDucation Bundle} (AeB), freely +available from \url{www.acrotex.net}. Because E4X is used, we also require +\app{Acrobat~8 Pro} or later, and, since you have \textsf{Acrobat~8} or +later, my \LaTeX ing friend, this package will work for you with all +workflows: \app{dvips/Distiller}, \app{pdflatex} (including \app{lualatex}), +and \app{xelatex}. To emphasize, for non-\app{Distiller} workflow, the full +\app{Acrobat} application is still required to be your default {\PDF} viewer +on your own computer. + +\section{The Test File} + +The package \textsf{aebxmp} has a simple test file, +\textsf{aebxmp\_test.tex}, which is found in the \texttt{examples} folder. +After you build the {\PDF} and open the document in \app{Acrobat} for the first time, +the new metadata is imported; \marginpar{\raggedleft save the document}\emph{it is important to save the document} after +the data is imported. + +To use this package, you must have, in addition to Acrobat~8 Pro (or later), +installed on your computer a standard {\TeX} system, including the +latest version of AeB.\footnote{AeB can be downloaded from any CTAN +server, from \url{www.math.uakron.edu/~dpstory/webeq.html}, or from +\url{www.acrotex.net}.} + +\section{Metadata} + +The \pkg{hyperref} package provides basic metadata support, providing +a mechanism for providing the title, author, subject, and keywords. Beyond +these, we can include additional metadata. + +\subsection{Author, Author} + +The \pkg{hyperref} package allows you to specify an author or authors; +the \textsf{Web} package uses this through the \cs{title} command, which +passes its argument on to \pkg{hyperref} of inclusion in the PDF Info +dictionary. The authors names are not individually assessable through +JavaScript. In Acrobat~9, I believe, the JavaScript API includes the +\texttt{Doc.info.Authors} property, its value is an array of authors, +We can access each author using array notation: First author is +\texttt{this.info.Authors[0]}, second author is +\texttt{this.info.Authors[1]}, and so on. The number of authors is +obtained using the length property of arrays, \texttt{this.info.Authors.length}. + +The \pkg{aebxmp} interface to this is through the \cs{Authors} command. It takes +a list of authors, each enclosed in braces, no commas (,) between the +authors. Like so: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Authors{{D. P. Story}{J\u00FCrgen Gilg}} +\end{Verbatim} +Using \cs{Authors} will overwrite the author(s) named in the \cs{author} +command (of \pkg{web}), or more generally, passed to +\cs{hypersetup\darg{pdfauthor=\darg{\anglemeta{author}}}} of +\pkg{hyperref}.\begin{NoHyper}\footnote{This may be to your advantage when +using \textsf{Web}; the value of \cs{author} is used to display the author(s) +of the document, you may want to present the names one way on the title page, +for example, and another way in the \textsf{Description} tab of the +\textsf{Document Properties} dialog box.}\end{NoHyper} + +If you do use \cs{Authors} and overwrite the author(s) as passed through +\pkg{hyperref}, the first author listed will be the one returned by +\texttt{this.info.Author} (a JavaScript property) in the \uif{Document +Properties} dialog box (\texttt{Ctrl+D}), all authors are listed in a +semi-colon delimited list. + + +\subsection{The \texorpdfstring{\cs{Keywords}}{\textbackslash{Keywords}} Command} + +The \cs{Authors} command utilizes \texttt{Doc.info.Authors}, which takes +an array of authors names. There is no such property available for +\texttt{Doc.info.Keywords}, the value of this property takes only a string +of keywords. The keywords are stored by Acrobat in three ways, +(1) \texttt{pdf:Keywords}; (2) in the \textbf{Info} dictionary; and (3) in +\texttt{dc:subject}. In the latter case, \texttt{dc:subject} takes a \texttt{Bag} +of subjects (keywords). A \texttt{Bag}, in XMP parlance, is an unordered array. + +The command \cs{Keywords} takes a comma delimited list of keywords. Notice +the word is capitalized to distinguish it from \cs{keywords}, which is +defined in the \textsf{Web} package as the interface to inserting the +keywords, via \pkg{hyperref}, into the \textbf{Info} dictionary. +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Keywords{AcroTeX.Net,XMP,E4X,Adobe Acrobat,JavaScript} +\end{Verbatim} +The command takes each comma-delimited list of keywords and +inserts each into the \texttt{dc:subject} part of the metadata. +For this document, the keywords appear in the XML metadata as +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +<dc:subject> + <rdf:Bag> + <rdf:li>AcroTeX.Net</rdf:li> + <rdf:li>XMP</rdf:li> + <rdf:li>E4X</rdf:li> + <rdf:li>Adobe Acrobat</rdf:li> + <rdf:li>JavaScript</rdf:li> + </rdf:Bag> +</dc:subject> +\end{Verbatim} +When the document is first opened, the following command is executed +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +this.info.Keywords="AcroTeX.Net; XMP; E4X; Adobe Acrobat; JavaScript" +\end{Verbatim} +Here, I have broken the string across lines for readability. This inserts +the same list of keywords into the \textbf{Info} dictionary. + +When you executed \texttt{this.info.Keywords} in the console, you'll get +% +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +AcroTeX.Net; XMP; E4X; Adobe Acrobat; JavaScript +\end{Verbatim} +as expected. + +To access the individual keywords, I've defined an array of keywords, +\texttt{aKeywords}. It takes as its argument the index of the +keyword you want to get; For example, executing \texttt{aKeywords[0]} in +the console returns a value of \texttt{"AcroTeX.Net"}, while +\texttt{aKeywords[4]} returns a value of \texttt{"JavaScript"}. If you +execute \texttt{aKeywords[5]}, a value of \texttt{undefined} is returned. +The number of keywords is \texttt{aKeywords.length}. + +Listing the keywords may be of interest to someone, it is an exercise to +me.\begin{NoHyper}\footnote{Actually, this is the way \textbf{Acrobat} handles a +comma-delimited list of keywords when the words are entered through +the user interface; it puts them in a \texttt{Bag}.}\end{NoHyper} + +The command \cs{xmpDoNotInsKWScript}, when expanded in the preamble, will +turn off the creation of the array \texttt{aKeywords}. + +\subsection{Additional Metadata} + +As mentioned previously, the \pkg{aebxmp} package addresses three areas of +interest: Setting the \uif{Copyright Status}, \uif{Copyright Notice}, and the +\textsf{Copyright Info URL}. Obviously, other elements of the XMP can be +addressed. To that end, the \pkg{aebxmp} package defines five new {\LaTeX} +commands to populate the values of the five metadata fields \textsf{Copyright +Status}, \uif{Copyright Notice}, \uif{Copyright Info URL}, \uif{Author +Title}, and \uif{Writer Description}. Values for the arguments of these +commands are documented below. +\begin{description} +\item[\cs{copyrightStatus\darg{True|False}}:] If \texttt{True}, + \uif{Copyright Status} is set to \texttt{Copyrighted}; if + \texttt{False}, \textsf{Copyright Status} is set to \uif{Public + Domain}. If left empty, the status is set to \uif{Unknown}. + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getCopyrightStatus()} + is available. The function returns the copyright status: + \texttt{Copyrighted}, \texttt{Public Domain}, and \texttt{Unknown}. + +\item[\cs{copyrightNotice\darg{\anglemeta{text}}}:] The \anglemeta{text} of + the \textsf{Copyright Notice} is defined + +\item[\cs{copyrightInfoURL\darg{\anglemeta{URL}}}:] The \anglemeta{URL} to + the copyright information + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getCopyrightInfoURL()} + is available. The function returns the copyrightinfo URL (\anglemeta{URL}). + +\item[\cs{authortitle\darg{\anglemeta{text}}}:] The \anglemeta{text} appears + in the \textsf{Author Title} line on the \textsf{Additional Metadata} + dialog box. This is a \uif{Photoshop} property. (See the \uif{Advanced} + category in the left panel.) + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getAuthorTitle()} + is available. The function returns the authortitle (\anglemeta{text}). + +\item[\cs{descriptionwriter\darg{\anglemeta{text}}}:] The \anglemeta{text} + appears in the \textsf{Description Writer} line on the \uif{Additional + Metadata} dialog box. This is a \uif{Photoshop} property. (See the + \uif{Advanced} category in the left panel.) + + Unless you've executed \cs{xmpDoNotInsKWScript} in the preamble, the + \pkg{aebxmp} defined JavaScript function \texttt{getDescriptionWriter()} + is available. The function returns the descriptionwriter (\anglemeta{text}). + +\end{description} + +\newtopic\noindent +For example, for this document, we have in the preamble, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\end{Verbatim} +Enter unicode (\cs{uXXXX}) directly into the \cs{copyrightNotice} and \cs{copyrightInfoURL} fields; for example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightNotice{Copyright (C) 2006-\the\year, J\u00FCrgen Gilg} +\end{Verbatim} +Unicode can be used all the metadata commands discussed in the manual. + +The \cs{copyrightNotice} can take multiple arguments, one for each +language. The syntax is +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont,commandchars=!()] +\copyrightNotice{% + {[!anglemeta(lang!SUB(1))] copyright in this language} + {[!anglemeta(lang!SUB(2))] copyright in this language} + ... +} +\end{Verbatim} +The first copyright item listed is also counted as the default language +and will be marked as \texttt{x-default} as the value of the +\texttt{xml:lang} attribute. Contrary to {\LaTeX} custom, the brackets do +not indicate optional arguments, they are required except for the first +item in the list. Each group, which are enclosed in braces +(\texttt{\{\}}), represents a copyright notice; the part enclosed on +brackets (\texttt{[]}) contains the language designator. This is a +two-letter code to indicate the language; it can also have a sub-tag to +indicate a country (see \texttt{en-US} in example below). See the ISO +639-1 standard, and the RFC 3066 standard, referenced at the end of the +manual, for more information on language codes. + +For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\copyrightNotice{% + {[en-US]Copyright (C) \the\year, D. P. Story} + {[fr]Copyright (C) \the\year, D. P. Story} + {[de]Copyright (C) \the\year, D. P. Story} +} +\end{Verbatim} + +There is also a \cs{sourceFile} command that takes one argument. If +\cs{sourceFile} does not appear in the preamble, the \cs{jobname.tex} is +written to the metadata (as part of the Dublin Core Properties). If +\verb!\sourceFile{}! is expanded in the preamble, no source file data will +be inserted into the metadata. Finally, executing the command +\verb!\sourceFile{hw01_1100.tex}! causes the string +\texttt{hw01\_1100.tex} to be written as the value of the +\texttt{dc:source} key. + + +\subsection{\texorpdfstring{\cs{Title}, \cs{Subject}, and \cs{metaLang}} + {\textbackslash{Title}, \textbackslash{Subject}, \textbackslash{metaLang}}} + +The Title and Subject keys can also be recorded with alternate languages; +for this reason, \textsf{aebxmp} defines \cs{Title} and \cs{Subject}. +The syntax of these two are similar to \cs{copyrightNotice}, described +above +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +\Title{% + {[!anglemeta(lang!SUB(1))] title in this language} + {[!anglemeta(lang!SUB(2))] title in this language} + ... +} +\Subject{% + {[!anglemeta(lang!SUB(1))] subject in this language} + {[!anglemeta(lang!SUB(2))] subject in this language} + ... +} +\end{Verbatim} +The first one listed is also designated as the default language, marked +with \texttt{x-default}. + +For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\Title{% + {[en-US]Testing the aebxmp Package} + {[fr]Test du paquet aebxmp} + {[de]Testen des aebxmp Pakets} +} +\Subject{% + {[en-US]Test file for using E4X to update the XMP Data Model} + {[fr]Fichier de test utilisant E4X pour mettre à jour + le modèle de données XMP} + {[de]Testdatei für die Verwendung von E4X, um das XMP Daten + Modell zu aktualisieren} +} +\end{Verbatim} +Note that literal characters such as \texttt{\"{u}} are also +recognized so that unicode is not needed here. + +The arrays \texttt{aTitle} and \texttt{aSubject} are defined in the +document, unless the command \cs{xmpDoNotInsKWScript} is executed in the +preamble. For example, if you executed \texttt{aTitle[0]} in the console +(or part of a JavaScript action of a button), the array element is seen to +be \texttt{"[x-default]:\,Testing the aebxmp Package"}, while +\texttt{aTitle[1]} is \texttt{"[en-US]:\,Testing the aebxmp Package"}. The +array \texttt{aSubject} behaves similarly. + +The data passed by \cs{Title} and \cs{Subject} overrides the data passed +by the \textsf{web} commands \cs{title} and \cs{subject}, and overrides +the data passed by the \pkg{hyperref} keys \texttt{pdftitle} and +\texttt{pdfsubject}. + +Special characters need to be entered using unicode (\cs{uXXXX}), not the +octal or unicode generated by \pkg{hyperref}. Do not use {\LaTeX} +markup that expands to special characters inside the arguments of any of +the commands defined in this package. + +The \cs{metaLang} command allows you to document the languages used in +the metadata. Multiple languages may be specified. +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +\metaLang{!anglemeta(lang!SUB(1)),!anglemeta(lang!SUB(2)),..,!anglemeta(lang!SUB(n))} +\end{Verbatim} +For example +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\metaLang{en,en-US,fr,de} +\end{Verbatim} + + +\subsection{Custom Document Properties} +You can define custom properties using the \cs{customProperties} command. +\bVerb +\begin{minipage}{.5\linewidth} +\def\1{\textbf{Standard Syntax}}% +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +!1 +\customProperties +{% + {name=!anglemeta(name!SUB(1)),value=!anglemeta(value!SUB(1))} + {name=!anglemeta(name!SUB(2)),value=!anglemeta(value!SUB(2))} +} +\end{Verbatim} +\end{minipage}\hfil +\begin{minipage}{.5\linewidth} +\def\1{\textbf{Colon Syntax}}% +\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!(),fontsize=\fontsize{9}{11}\selectfont] +!1 +\customProperties +{% + {name:!anglemeta(name!SUB(1)),value:!anglemeta(value!SUB(1))} + {name:!anglemeta(name!SUB(2)),value:!anglemeta(value!SUB(2))} +} +\end{Verbatim} +\end{minipage} +\eVerb +The `colon' syntax is also recognized, but do not mix the two syntaxes together, use either all equal signs or all colons. + +The value of the \texttt{name} key requires a unique name, which must not +be one of the standard property names \texttt{Title}, \texttt{Author}, \texttt{Subject}, \texttt{Keywords}, +\texttt{Creator}, \texttt{Producer}, \texttt{CreationDate}, \texttt{ModDate}, and +\texttt{Trapped}. The value of \texttt{name} shall consist of the +characters \texttt{A--Z}, \texttt{a--z}, and \texttt{0--9}, and beginning with a +letter. The value may contain unicode, for example, in the preamble of +this document we have, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=J\u00FCrgen Gilg} +} +\end{Verbatim} +Instead of unicode, this same set of custom properties can be defined as +follows: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{11}\selectfont] +\customProperties +{% + {name=Developer,value={D. P. Story, Esq.}} + {name=Motivator,value=Jürgen Gilg} +} +\end{Verbatim} +That is, using literal characters, if your editor supports it. + +The properties may be accessed through the \texttt{info} property of the +\texttt{Doc} object. The button (on the left) \marginpar{\hfill\pushButton[\TU{Press to see the document +properties}\CA{Info} +\A{\JS{% + console.show();\r + console.clear();\r + for (var o in this.info)\r\t + console.println("info."+o+"="+this.info[o]);\r + if (aKeywords!=undefined) {\r\t + console.println("List Keywords:");\r\t + for (var i=0; i< aKeywords.length; i++){\r\t\t + console.println(" "+aKeywords[i]);\r\t + }\r + } +}}]{info}{}{11bp}} +opens the console debugger window and displays all the document +properties. + + +The custom properties may be viewed using the user interface; press +\texttt{Ctrl+D} and choose the \textsf{Custom} tab. + +For more information on this topic, see +\href{http://www.adobe.com/devnet/xmp.html}{% +Part 3, Storage in Files}, section 3.2 on \textbf{Native metadata in PDF files}, in particular, +see section~3.2.1 concerning user-defined document properties. + + +\section{Checking for validity} + +While looking at this file in Acrobat (or Adobe Reader), press +\texttt{Ctrl+D} to get the \textsf{Document Properties} dialog box. +Select the \textsf{Description} tab and click \textsf{Additional +Metadata}. Since this document was built using the \textsf{aebxmp} +package, with the declarations + +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\fontsize{9}{12}\selectfont] +\copyrightStatus{True} +\copyrightNotice{Copyright (C) 2006-\the\year, D. P. Story} +\copyrightInfoURL{http://www.acrotex.net} +\authortitle{Programming and Development, AcroTeX.Net} +\descriptionwriter{Testing and Promotions Department, AcroTeX.Net} +\end{Verbatim} + +\newtopic In the Advanced Metadata dialog box, you should see, +\begin{itemize} + \item[] \textsf{Copyright Status}: \texttt{Copyrighted} + \item[] \textsf{Copyright Notice}: \texttt{Copyright (C) 2006-\the\year, D. P. Story} + \item[] \textsf{Copyright Info URL}: \texttt{http://www.acrotex.net} + \item[] \textsf{Author Title}: \texttt{Programming and Development, + AcroTeX.Net} + \item[] \textsf{Description Writer}: \texttt{Testing and Promotions Department, + AcroTeX.Net} +\end{itemize} +in addition to the usual Document Title, Author, Description, and +Keywords. I promise you that I did not enter these values through the user interface. \texttt{:-)} +\section{Resources} + +\newtopic The resources for the development of this package are +\begin{itemize} + \item \textsl{Standard ECMA-357: ECMAScript for XML (E4X) Specification},\\ + {\small\url{http://www.ecma-international.org/publications/standards/Ecma-357.htm}} + \item \textsl{XMP Specification}, \url{http://www.adobe.com/devnet/xmp.html} + \item \textsl{Acrobat JavaScript Scripting Reference}, Version 8.0\\ + \url{http://www.adobe.com/go/acrobat_developer} + \item \textsf{hyperxmp} package by Scott Pakin, + \url{http://ctan.org/pkg/hyperxmp} + \item The {\AcroTeX} System Tools, available for free download at \url{www.acrotex.net}. This is + a {\LaTeX}-based system. + \item ISO 639-1 two-letter abbreviation.\\ + \url{http://www.loc.gov/standards/iso639-2/php/English_list.php} + \item IETF RFC 3066\\ + \url{http://www.ietf.org/rfc/rfc3066.txt} + +% http://www.iana.org/assignments/language-subtag-registry + +\end{itemize} + +\newtopic\noindent +Now, I simply must get back to my retirement. \dps + +\end{document} diff --git a/texmf-dist/source/latex/annot-pro/annot_pro.dtx b/texmf-dist/source/latex/annot-pro/annot_pro.dtx new file mode 100644 index 00000000..7e30b00e --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/annot_pro.dtx @@ -0,0 +1,1162 @@ +% \iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% annot_pro package, %% +%% Copyright (C) 2002-2016 D. P. Story %% +%% dpstory@uakron.edu %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesPackage{annot_pro} +%<package> [2016/10/18 v1.1b Provides selected PDF annotation support (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[fleqn]{amsmath} +\usepackage[colorlinks,hyperindex=false]{hyperref} +\let\uif\textsf\let\app\textsf +\let\pkg\textsf\let\env\texttt +\def\psf#1{\textsf{\textbf{#1}}} +%\def\texorpdfstring#1#2{#1} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +\OnlyDescription % comment out for implementation details +\EnableCrossrefs \CodelineIndex \RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{annot_pro}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{annot_pro}{aebdocfmt.def cannot be found}} +\begin{document} + \GetFileInfo{annot_pro.sty} + \title{annot\_pro: Selected PDF Annotations} + \author{D. P. Story\\ + Email: \texttt{dpstory@uakron.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{annot_pro.dtx} +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} +The index goes here. Execute +\begin{quote} + \texttt{makeindex -s gind.ist -o annot\_pro.ind annot\_pro.idx} +\end{quote} + on the command line and recompile \texttt{annot\_pro.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list +of changes goes here. Execute +\begin{quote} + \texttt{makeindex -s gglo.ist -o annot\_pro.gls annot\_pro.glo} +\end{quote} + on the command line and recompile \texttt{annot\_pro.dtx}.} +\end{document} +%</driver> +% \fi +% +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}} +% {\PackageInfo{web}{cannot find aebdonotindex.def}} +% +% \begin{macrocode} +%<*package> +\RequirePackage{xkeyval} +% \end{macrocode} +% \changes{v1.1}{2016/09/29}{Introduced Free Text annotation} +% \changes{v1.0c}{2016/09/28}{Reformatted manual, reformatted DTX file} +% \section{Background Information} +% +% The following annotation types will be supported (taken from table 8.20) +%\begin{itemize} +% \item \textbf{Text}: Subtype \textbf{Text}. See Table 8.23, page 621. In particular, the values +% of the \textbf{Name} key are \textbf{Comment}, \textbf{Help}, \textbf{Insert}, \textbf{Key}, \textbf{NewParagraph}, +% \textbf{Note} (the default), and \textbf{Paragraph}. Other supported names are \textbf{Check}, \textbf{Circle}, \textbf{Cross}, +% \textbf{Star}, \textbf{RightArrow}, \textbf{RightPointer}, \textbf{UpArrow}, \textbf{UpLeftArrow} +% \item \textbf{Stamp}: Subtype \textbf{Stamp}. See Table 8.32, page 635. The values of the \textbf{Name} key are +% \textbf{Approved}, \textbf{AsIs}, \textbf{Confidential}, +% \textbf{Departmental}, \textbf{Draft} (the default), +% \textbf{Experimental}, \textbf{Expired}, \textbf{Final}, +% \textbf{ForComment}, \textbf{ForPublicRelease}, \textbf{NotApproved}, +% \textbf{NotForPublicRelease}, \textbf{Sold}, \textbf{TopSecret}. +% \item \textbf{FileAttachment}: Subtype \textbf{FileAttachment}. Table 8.35, page 638. The Name key has values +% \textbf{Graph}, \textbf{Paperclip}, \textbf{PushPin}, and \textbf{Tag}. +%\end{itemize} +% The options available for any supported annotation +%\begin{itemize} +% \item \verb!type=text | stamp | fileattachment! (text, the default) +% \item \texttt{Contents} will be an argument of the command \cs{annotpro} +% \item \texttt{NM} unique name for the page, optional, if not provided, +% one will be generated. +% \item \texttt{color}, to color the annotation +% \item \verb!margin! to place the annotation in the margin +% \item \texttt{nohspace}, leave no horizontal space +% \item \texttt{novspace}, leave no vertical space +% \item \texttt{nospace}, leave neither vertical or horizontal space. +%\end{itemize} +% \section{Annotation types supported} +% \subsection{Text Annotations} +% The options for the text annotation (\texttt{type=text}) are +%\begin{itemize} +% \item \texttt{name}, one of the standard icons listed above, default Note +% \item \texttt{open}, default \texttt{false} +%\end{itemize} +% \subsection{Rubber Stamp Annotations} +% The options for the text annotation (\texttt{type=stamp}) are +%\begin{itemize} +% \item \texttt{name}, the default is draft. If a name begins with \texttt{\#}, that signals +% a custom appearance. +% \item \texttt{ap}, when the name is a custom name, the \texttt{ap} is used to hold the indirect reference +% to the appearance. If a custom name is specified, \texttt{ap} is required, and \textsf{graphicxsp} is required. +% \item \texttt{open}, default \texttt{false} +%\end{itemize} +% \subsection{File Attachment Annotations} +% The options for the text annotation (\texttt{type=fileattachement}) are +%\begin{itemize} +% \item \texttt{name}, the default is \texttt{PushPin}. +% \item \texttt{file}, the file specification \textbf{FS} key +%\end{itemize} +% \subsection{Text Box (Free Text) Annotations} +% Beginning with Free Text +% \begin{macrocode} +\DeclareOptionX{preview}{\previewtrue} +\@ifundefined{ifpreview}{\newif\ifpreview\previewfalse}{} +% \end{macrocode} +% \changes{v1.1}{2016/09/29}{Added \string\texttt{useA10Icons} and \string\texttt{useTextBox} options} +% (2016/09/29) Added \texttt{useA10Icons} and \texttt{useTextBox} options +% \begin{macrocode} +\newif\ifuseAAXdim\useAAXdimtrue +\DeclareOptionX{useA10Icons}{\useAAXdimtrue} +\DeclareOptionX{!useA10Icons}{\useAAXdimfalse} +% \end{macrocode} +% Require \pkg{richtext}, dated 2016/10/03 or later. +% \changes{v1.1a}{2016/10/18}{Require \string\pkg{richtext}, dated 2016/10/03 or later.} +% \changes{v1.1b}{2016/10/18}{Corrected date specification} +% \begin{macrocode} +\DeclareOptionX{useTextBox}{\def\ap@requireRichTextAsNeeded{% + \RequirePackage{richtext}[2016/10/03]}} +\let\ap@requireRichTextAsNeeded\relax +\ProcessOptionsX\relax +\RequirePackage{hyperref} +\RequirePackage{calc} +\RequirePackage{insdljs} +\RequirePackage[structure]{taborder} +\ap@requireRichTextAsNeeded +% \end{macrocode} +% We see if \textsf{graphicxsp} is loaded, and set a simple switch one way or the other. +% This switch is later used when creating a custom stamp. +% \begin{macrocode} +\@ifpackageloaded{graphicxsp}{% + \let\ap@graphicxsp=1}{\let\ap@graphicxsp=0} +% \end{macrocode} +% For now, we'll support setting the tab order only if the \pkg{eforms} package is loaded. +% \begin{macrocode} +\@ifpackageloaded{eforms}{} + {\newif\ifto@structOrder\to@structOrderfalse} +% \end{macrocode} +% \cs{csarg} from \pkg{comments} package, handy. +% \begin{macrocode} +\def\ap@csarg#1#2{\expandafter#1\csname#2\endcsname} +% \end{macrocode} +% Definitions for creating a rectangle used to create a building box for the annot. +% This switch is later used when creating a custom stamp. +% \begin{macrocode} +\def\ap@Bbox#1#2{% + \edef\bbox@width{#1}\edef\bbox@height{#2}% + \hbox{\ifpreview\setlength\fboxrule{0.4pt}\setlength\fboxsep{0pt}% + \@tempdima=\bbox@width\advance\@tempdima by-\fboxrule + \@tempdimb=\bbox@height\advance\@tempdimb by-\fboxrule + \fbox{\parbox[c][\@tempdimb][c]{\@tempdima}{\hfill\vfill}}\else + \parbox[c][\bbox@height][c]{\bbox@width}{\hfill\vfill}\fi}% +} +% \end{macrocode} +% The postscript operators \texttt{pdf@llx}, etc., are defined in \textsf{hyperref}. +% \begin{macrocode} +\def\ap@Rect{/Rect [pdf@llx pdf@ury pdf@urx pdf@lly]} +% \end{macrocode} +% \begin{macro}{\defineAPath} +% A simple macro to define path. +% \begin{macrocode} +\newcommand{\defineAPath}[1]{\def\ap@ctrl@Name{#1}% + \hyper@normalise\ap@defineAPath} +\def\ap@defineAPath#1{\expandafter\xdef\ap@ctrl@Name{#1}} +% \end{macrocode} +% \end{macro} +% \section{Key-Value Pairs for \texorpdfstring{\protect\cs{annotpro}}{\textbackslash annotpro}} +% \begin{macro}{type} +% We support three types of annotation, text, stamp, and fileattachment. +% \begin{macrocode} +\define@choicekey+{annotpro}{type}[\val\nr]% + {text,stamp,fileattachment,textbox}[text]{% + \edef\ap@save@type{\nr}% + \ifcase\nr\relax + \def\ap@type{Text}\or + \def\ap@type{Stamp}\or + \def\ap@type{FileAttachment}\or + \def\ap@type{FreeText}\fi +}{\PackageWarning{annot_pro}{Bad choice for type, permissible values + are text, stamp, fileattachment, textbox. Try again}} +\def\ap@freetext@type{3} +\let\ap@type\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{name} +% The name key can have many different values. The permitted values are +% a function of the \texttt{type}. +% \begin{macrocode} +\define@key{annotpro}{name}[]{\def\annotpro@name{#1}} +\let\annotpro@name\@empty +% \end{macrocode} +% \end{macro} +% For a text annotation, the following are permitted values for \texttt{name}: +% \begin{macrocode} +\define@choicekey+{annnotprotext}{name}{% +Comment,Key,Note,Help,NewParagraph,Paragraph,Insert,Check,% +Circle,Cross,Star,RightArrow,RightPointer,UpArrow,UpLeftArrow,% +CrossHairs}[Note]{\def\annotpro@@name{#1}}% +{\PackageWarning{annot_pro}{Bad choice for name, permissible values +are Comment, Key, Note, Help, NewParagraph, Paragraph, Insert, Check, +Circle, Cross, Star, RightArrow, RightPointer, UpArrow, +UpLeftArrow, CrossHairs. Try again}} +\let\annotpro@@name\@empty +% \end{macrocode} +% For a stamp annotation, the following are permitted values for \texttt{name}. +% \begin{macrocode} +\define@choicekey+{annnotprostamp}{name}{% +Approved,AsIs,Confidential,Departmental,Draft,% +Experimental,Expired,Final,ForComment,% +ForPublicRelease,NotApproved,NotForPublicRelease,Sold,% +TopSecret}[Draft]{\def\annotpro@@name{#1}}% +{\def\ap@custom@name{#1}} +\let\ap@custom@name\@empty +% \end{macrocode} +% If the user enters a value other than the one listed, that value is recorded +% in the text macro \cs{ap@custom@name}. Usually, the user would enter the +% names of stamps that come on his system, but are not part of the PDF Specs. +% \begin{macrocode} +% \end{macrocode} +% \begin{macro}{customStamp} +% There is a third case. The user can create a custom stamp using graphicxsp +% package. +% \begin{macrocode} +\define@key{annotpro}{customStamp}[]{\def\ap@customstamp@name{#1}} +\let\ap@customstamp@name\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{ap} +% When the user specifies \texttt{customStamp}, he must supply a custom appearence +% for the stamp with the \texttt{ap} key. The \textsf{graphicxsp} package is required +% for this option. +% \begin{macrocode} +\define@key{annotpro}{ap}[]{\def\annotpro@ap{#1}} +\let\annotpro@ap\@empty +% \end{macrocode} +% \end{macro} +% There is a third case. The user can create a custom stamp using graphicxsp +% package. +% \begin{macro}{width} +% \begin{macro}{height} +% \begin{macro}{rotate} +% \begin{macro}{scale} +% \begin{macro}{widthTo} +% \begin{macro}{heightTo} +% As of this writing, these are used when the user sets the name key equal +% to one of the many stamp names that come with Acrobat (other than ones +% that are documented in the PDF Specs. Use the width and height to set the +% bounding box. Normally, distiller, will place the largest stamp the box +% will hold, and center it in that box. (I think.) +% \begin{macrocode} +\define@key{annotpro}{width}[]{\def\annotpro@width{#1}} +\let\annotpro@width\@empty +\define@key{annotpro}{height}[]{\def\annotpro@height{#1}} +\let\annotpro@height\@empty +\define@key{annotpro}{rotate}[]{\def\annotpro@rotate{#1}} +\let\annotpro@rotate\@empty +\define@key{annotpro}{scale}[]{\def\annotpro@scale{#1}} +\let\annotpro@scale\@empty +\define@key{annotpro}{widthTo}[]{\def\annotpro@widthTo{#1}} +\let\annotpro@widthTo\@empty +\define@key{annotpro}{heightTo}[]{\def\annotpro@heightTo{#1}} +\let\annotpro@heightTo\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% For a file attachment annotation, the following are permitted values for \texttt{name}. +% \begin{macrocode} +\define@choicekey+{annnotprofileattach}{name}{% +Graph,Paperclip,PushPin,Tag}[PushPin]{\def\annotpro@@name{#1}} +{\PackageWarning{annot_pro}{Bad choice for name, permissible values +are Graph,Paperclip,PushPin,Tag. Try again}} +% \end{macrocode} +% \begin{macro}{file} +% When there is a file attachment, the absolute path to the file must be +% specified using the \texttt{file} key. A path to the file can be defined +% using \cs{defineAPath}. +% \begin{macrocode} +\define@key{annotpro}{file}[]{% + \edef\annotpro@file{#1}% + \ifx\annotpro@file\@empty\else + \edef\ap@exp@tmp{\noexpand\filename@parse{#1}}\ap@exp@tmp + \edef\ap@thisFileName{\filename@base.\filename@ext}\fi +} +\let\annotpro@file\@empty +\define@key{annotprofreetext}{name}[FreeText]{\def\annotpro@@name{#1}} +\define@key{annotprofreetext}{defstyle}[]{\def\annotpro@@ds{#1}} +\let\annotpro@@ds\@empty +\define@key{annotprofreetext}{richtext}[]{\def\annotpro@@rt{#1}} +\let\annotpro@@rt\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{margin} +% \begin{macro}{margintext} +% \begin{macro}{\margintextformat} +% When margin is used, the command \cs{marginpar} is used to place the annotation +% in the margins, this is nice for sticky notes (text annotations), small stamps, +% and file attachments. +% +% You can optionally place (small amount of) text under the icon in the margins. The +% format for the text can be redefined using the command \cs{margintextformat}. +% \begin{macrocode} +\define@key{annotpro}{margin}[0]{% + \def\annotpro@margin{0}} +\let\annotpro@margin\@empty +\define@key{annotpro}{margintext}[]{% + \def\apmargintext{\centering\break + \parbox{\linewidth}{\apmargintextformat\strut#1}}} +\let\apmargintext\@empty +\newcommand{\margintextformat}[1]{\def\apmargintextformat{#1}} +\margintextformat{\bfseries\tiny\color{blue}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{presets} +% A convenience key to allow the introduction of pre-defined options, for example, +% you might like all your comment fields to be red, so you can define +% \verb!\def\myComments{type=text,name=Comment,color=red}!, then say +%\begin{verbatim} +% \annotpro[presets=\myComment]{Way to go!} +%\end{verbatim} +% \begin{macrocode} +\define@key{annotpro}{presets}[]{\def\annotpro@presets{#1}} +\let\annotpro@presets\@empty +% \end{macrocode} +% Added 07/08/09 to support structure tab order. +% \end{macro} +% \begin{macro}{objdef} +% This is a pdfmark feature that inserts a references to this COS object, +% used with setting the tab order using the structure. Tabbing using structure +% is supported by \textsf{eforms}. +% \begin{macrocode} +\define@key{annotpro}{objdef}[]{\def\eq@objdef{/_objdef {#1}}% + \def\eq@objdefName{#1}} +\let\eq@objdef\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{taborder} +% \begin{macrocode} +\define@key{annotpro}{taborder}[]{\def\eq@taborder{#1}} +\let\eq@taborder\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{open} +% A key to set whether the popup annotation is open or not. +% \begin{macrocode} +\define@choicekey+{annotpro}{open}[\val\nr]{true,false}[true]{% + \def\annotpro@open{#1}}{\PackageWarning{annot_pro}{Bad + choice for open, permissible values are true and false. Try again}} +\def\annotpro@open{false} +% \end{macrocode} +% \end{macro} +% \begin{macro}{subject} +% \begin{macro}{title} +% The subject and title (usually the author's name) of the annotation +% \begin{macrocode} +\define@key{annotpro}{subject}[]{\def\annotpro@subject{#1}} +\define@key{annotpro}{title}[]{\def\annotpro@title{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{color} +% The color of the annotation. +% \begin{macrocode} +\define@key{annotpro}{color}[1 0 0]{\def\annotpro@color{#1}} +% \end{macrocode} +% For the FreeText annotation, we can specify background color \IndexOpt{bgcolor}\texttt{bgcolor}, +% (default white) and border color \IndexOpt{bcolor}\texttt{bcolor} (default black). +% \begin{macrocode} +\define@key{annotpro}{bgcolor}[]{\def\annotpro@bgcolor{#1}} +\def\annotpro@bgcolor{white} +\define@key{annotpro}{bcolor}[]{\def\annotpro@bcolor{#1}} +\let\annotpro@bcolor\@empty +\def\annotpro@def@bcolor{black} +\def\ap@BE@i{4.08768} +\def\ap@BE@i@calc{\ap@BE@i\space\ap@bwidthNum\space add} +\def\ap@BE@ii{8.26857} +\def\ap@BE@ii@calc{\ap@BE@ii\space add \ap@bwidthNum} +\define@choicekey+{annotpro}{borderstyle}[\val\nr]{none,solid,% + dash1,dash2,dash3,dash4,dash5,dash6,cloud1,cloud2}[solid]{% + \ifcase\nr\relax + \def\ap@border@code{}\or + \def\ap@border@code{/BS <</S/S\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[2.0 2.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[3.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 4.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 3.0 2.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[4.0 3.0 16.0 3.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BS <</D[8.0 4.0 4.0 4.0]/S/D\ap@bwidth>>}\or + \def\ap@border@code{/BE<</I 1.0/S/C>>/RD[\ap@BE@i@calc\space\ap@BE@i@calc + \space\ap@BE@i@calc\space\ap@BE@i@calc]% + \ifx\ap@bwidth\@empty\else/BS <<\ap@bwidth>>\fi}\or + \def\ap@border@code{/BE<</I 2.0/S/C>>/RD[\ap@BE@ii@calc\space\ap@BE@ii@calc + \space\ap@BE@ii@calc\space\ap@BE@ii@calc]% + \ifx\ap@bwidth\@empty\else/BS <<\ap@bwidth>>\fi}\fi + \def\annotpro@border{#1}}{\PackageWarning{annot_pro}{Bad + choice for borderstyle,\MessageBreak permissible values are none, solid,% + dash1, dash2, dash3,\MessageBreak dash4, dash5, dash6, cloud1, cloud2. Try again}} +\def\ap@border@code{/BS <</S/S\ap@bwidth>>} +\define@choicekey+{annotpro}{borderwidth}[\val\nr]{.5,1,2,3,4,6,8,10}[1]{% + \edef\ap@bwidthNum{\val}% + \def\ap@bwidth{/W #1}}{\PackageWarning{annot_pro}{Bad + choice for borderwidth,\MessageBreak permissible values are .5, 1, 2,\MessageBreak + 3, 4, 6, 8, 10. Try again}} +\def\ap@bwidthNum{1} +\let\ap@bwidth\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{readonly} +% Set the annotation to readonly. +% \begin{macrocode} +\define@key{annotpro}{readonly}[ 64 add]{\def\ap@readonly{#1}} +\let\ap@readonly\@empty +% \end{macrocode} +% \end{macro} +% \begin{macro}{nohspace} +% \begin{macro}{nohspace} +% \begin{macro}{nospace} +% These are used only with text annotations. The position of the +% annotation depends only on the upper-right corner. The bounding +% box can be made to have no width or not height, or both. The upper-left +% corner is always defined. The text annotation will take no horizontal, +% vertical, or no space at all in {\TeX} space. The same effect can be accomplished +% using 0pt width boxes or by smashing the bounding box. +% \begin{macrocode} +\define@key{annotpro}{nohspace}[]{\def\annotpro@hspace{0pt}} +\define@key{annotpro}{novspace}[]{\def\annotpro@vspace{0pt}} +\define@key{annotpro}{nospace}[]{\def\annotpro@hspace{0pt}% + \def\annotpro@vspace{0pt}} +\let\annotpro@hspace\@empty\let\annotpro@vspace\@empty +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{opacity} +% Set the \texttt{opacity} of the annot, if creating a custom stamp using +% graphicxsp, then the file needs to be distilled using \texttt{standard\_transparency} +% job settings for distiller. +% \begin{macrocode} +\define@key{annotpro}{opacity}[]{% + \def\ap@add@ops{[ /ca #1 /SetTransparency pdfmark}% + \def\annotpro@opacity{#1}} +\let\annotpro@opacity\@empty +% \end{macrocode} +% \end{macro} +% \subsection{Dimensions of Standard Text Icons} +% Using the user interface, and the dimensions of each of the standard text annotations +% were obtained and recorded here. +% \begin{macrocode} +% Note in A10, text annots are not 18bp x 18bp and A10 adds CrossHairs +\def\getargsiii#1#2#3{\def\ap@argi{#1}\def\ap@argii{#2}% + \def\ap@argiii{#3}} +\ifuseAAXdim +\@tfor\ap@text@dimen:={{Comment}{18bp}{18bp}}% +{{Key}{13bp}{18bp}}{{Note}{18bp}{20bp}}{{Help}{20bp}{20bp}}% +{{NewParagraph}{13bp}{20bp}}{{Paragraph}{20bp}{20bp}}% +{{Insert}{17bp}{20bp}}{{Check}{20bp}{19bp}}% +{{Circle}{20bp}{20bp}}{{Cross}{20bp}{19bp}}% +{{Star}{20bp}{19bp}}{{RightArrow}{20bp}{20bp}}% +{{RightPointer}{20bp}{17bp}}{{UpArrow}{17bp}{20bp}}% +{{UpLeftArrow}{17bp}{17bp}}{{CrossHairs}{20bp}{20bp}}\do{% + \expandafter\getargsiii\ap@text@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \else +\@tfor\ap@text@dimen:={{Comment}{20bp}{18bp}}% +{{Key}{18bp}{17bp}}{{Note}{18bp}{20bp}}{{Help}{20bp}{20bp}}% +{{NewParagraph}{13bp}{20bp}}{{Paragraph}{11bp}{20bp}}% +{{Insert}{20bp}{17bp}}{{Check}{20bp}{19bp}}% +{{Circle}{20bp}{20bp}}{{Cross}{20bp}{20bp}}% +{{Star}{20bp}{19bp}}{{RightArrow}{20bp}{14bp}}% +{{RightPointer}{20bp}{18bp}}{{UpArrow}{19bp}{20bp}}% +{{UpLeftArrow}{17bp}{17bp}}{{CrossHairs}{24bp}{24bp}}\do{% + \expandafter\getargsiii\ap@text@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \fi +% \end{macrocode} +% \subsection{Dimensions of Standard File Attachment Icons} +% Similarly, the dimensions of each of the standard file attachment annotations +% were obtained and recorded. All these dimensions have been reduced by 2pt, so that there final +% dimensions match what is displayed through the ui. +% \begin{macrocode} +\ifuseAAXdim +\@tfor\ap@fa@dimen:={{Graph}{20bp}{20bp}} + {{Paperclip}{7bp}{17bp}}{{PushPin}{14bp}{20bp}} + {{Tag}{20bp}{16bp}}\do{% + \expandafter\getargsiii\ap@fa@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +\else +\@tfor\ap@fa@dimen:={{Graph}{18bp}{18bp}} + {{Paperclip}{5bp}{15bp}}{{PushPin}{12bp}{18bp}} + {{Tag}{18bp}{14bp}}\do{% + \expandafter\getargsiii\ap@fa@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} \fi +% \end{macrocode} +% \subsection{Dimensions of Standard Stamp Appearances} +% +% Some default stamp dimensions, when the dimensions are not known or provided. May be +% redefined. +% \begin{macrocode} +\newcommand{\defaultStampWidth}{50bp} +\newcommand{\defaultStampHeight}{50bp} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Standard.pdf} +% \begin{macrocode} +\newcommand{\standardStampWidth}{245.38bp} +\newcommand{\standardStampHeight}{64.53bp} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{StandardBusiness.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{SBApproved}{163.50bp}{49.50bp}} +{{SBCompleted}{175.87bp}{49.50bp}} +{{SBConfidential}{209.62bp}{49.50bp}} +{{SBDraft}{113.14bp}{49.75bp}} +{{SBFinal}{97.80bp}{49.75bp}} +{{SBForComment}{211.87bp}{49.50bp}} +{{SBForPublicRelease}{290.04bp}{49.55bp}} +{{SBInformationOnly}{275.00bp}{49.55bp}} +{{SBNotApproved}{218.62bp}{49.50bp}} +{{SBNotForPublicRelease}{346.04bp}{49.55bp}} +{{SBPreliminaryResults}{304.04bp}{49.55bp}} +{{SBVoid}{91.04bp}{49.75bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{SignHere.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{SBRejected}{22.68bp}{22.66bp}} +{{SHAccepted}{23.29bp}{20.45bp}} +{{SHInitialHere}{99.69bp}{30.34bp}} +{{SHSignHere}{99.69bp}{30.34bp}} +{{SHWitness}{99.69bp}{30.34bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{\texttt{Dynamic.pdf}} +% \begin{macrocode} +\catcode`\#=11\relax +\@tfor\ap@dimen:={{#DApproved}{255.64bp}{53.83bp}} +{{#DConfidential}{163.28bp}{57.10bp}} +{{#DReceived}{255.64bp}{55.11bp}} +{{#DReviewed}{255.64bp}{55.11bp}} +{{#DRevised}{127.47bp}{55.85bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +\catcode`\#=6\relax +\newcommand{\stampWidth}[1]{\csname ap@#1Width\endcsname} +\newcommand{\stampHeight}[1]{\csname ap@#1Height\endcsname} +% \end{macrocode} +% The dimensions of the stamp appearances in the file Words.pdf +% \begin{macrocode} +\@tfor\ap@dimen:={{WordsAGenuineFind}{120.68bp}{190.83bp}} +{{WordsBigSavings}{282.84bp}{117.86bp}} +{{WordsDeals}{345.40bp}{132.55bp}} +{{WordsHappyBirthday}{326.50bp}{166.32bp}} +{{WordsHot}{249.64bp}{176.75bp}} +{{WordsLookWhatsNew}{316.59bp}{229.81bp}} +{{WordsNeato}{171.12bp}{86.88bp}} +{{WordsTheBestJustGotBetter}{153.53bp}{153.53bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Faces.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{FacesEcstatic}{223.20bp}{202.80bp}} +{{FacesElectric}{295.80bp}{280.50bp}} +{{FacesGrumpy}{289.92bp}{194.64bp}} +{{FacesHappy}{161.65bp}{161.65bp}} +{{FacesHurt}{289.50bp}{285.75bp}} +{{FacesNeutral}{291.04bp}{279.32bp}} +{{FacesSmirk}{276.75bp}{292.50bp}} +{{FacesSurprised}{220.08bp}{215.04bp}} +{{FacesWorried}{298.11bp}{235.12bp}} +{{FacesWow}{242.32bp}{289.17bp}} +{{FacesZippy}{290.59bp}{263.81bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% The dimensions of the stamp appearances in the file \texttt{Pointers.pdf} +% \begin{macrocode} +\@tfor\ap@dimen:={{PointersBogus}{128.32bp}{53.82bp}} +{{PointersBug}{128.32bp}{51.94bp}} +{{PointersDOA}{136.99bp}{51.48bp}} +{{PointersFYEO}{128.32bp}{48.60bp}} +{{PointersFix}{145.60bp}{58.11bp}} +{{PointersNuke}{128.32bp}{52.30bp}} +{{PointersOptimize}{128.32bp}{48.60bp}} +{{PointersRedFlag}{128.32bp}{57.12bp}} +{{PointersValidate}{128.32bp}{48.60bp}} +{{PointersWarning}{128.32bp}{57.23bp}} +{{PointersWhen}{128.32bp}{63.79bp}}\do{% + \expandafter\getargsiii\ap@dimen + \ap@csarg\edef{ap@\ap@argi Width}{\ap@argii}% + \ap@csarg\edef{ap@\ap@argi Height}{\ap@argiii}% +} +% \end{macrocode} +% \subsection{Default dimensions of Free Text annotation} +% \begin{macrocode} +\def\ap@FreeTextWidth{144bp} +\def\ap@FreeTextHeight{72bp} +% \end{macrocode} +% \begin{macro}{\makeStamp} +% A command to help the creation of custom stamps using graphicxsp. You've got to see it +% to believe it. +% \begin{macrocode} +\newcommand{\makeStamp}[3]{% +\ap@csarg\def{stamp@#2}{% + \begin{sp@createImage}{#1}{#2\the\ap@cusstamp@cnt} + \ap@add@ops#3 + \end{sp@createImage}}} +\let\ap@add@ops\@empty +% \end{macrocode} +% \end{macro} +% This command is used internal in \cs{annotpro} to generate an appearance for +% the stamp. +% \begin{macrocode} +\newcommand{\ap@useStamp}[1]{% + \global\advance\ap@cusstamp@cnt1\relax + \@nameuse{stamp@#1}} +% \end{macrocode} +% \begin{macro}{\setAnnotOptions} +% A command for setting global options. +% \begin{macrocode} +\newcommand{\setAnnotOptions}[1]{% + \setkeys{annotpro}{#1}% +} +% \end{macrocode} +% \end{macro} +% The following code is taken from the \textsf{datetime} package (and modified) as maintained by +% Nicola Talbot. There is no need for the whole package, we just need +% \cs{pdfdate}, named \cs{ap@pdfdate} in \textsf{annot\_pro}. We make all calculations in a group. +%\changes{v1.0a}{2011/07/14}{Added \cs{ap@pdfdate}} +% \begin{macrocode} +\begingroup +\def\withoptz@#1{\ifnum#1<10 0\fi\the#1} +\edef\ap@pdfdate{\the\year\withoptz@\month\withoptz@\day} +% \end{macrocode} +% Calculate the minutes after the hour time by dividing by 60. +% \begin{macrocode} +\count0=\time \count2=\count0 +% \end{macrocode} +% Calculate the number of hours after midnight by dividing by 60 +% \begin{macrocode} +\divide\count2by60 +\edef\ap@pdfdate{\ap@pdfdate\withoptz@{\count2}} +\multiply\count2by60 \advance\count0by-\count2 +\xdef\ap@pdfdate{\ap@pdfdate\withoptz@{\count0}00} +\endgroup +% \end{macrocode} +% \section{The main code} +% \begin{macrocode} +\newcount\ap@annot@cnt +\newcount\ap@cusstamp@cnt +{\catcode`\#=12\gdef\ap@signalCustomAP{#}} +\def\pStamp#1{\ap@signalCustomAP#1} +% \end{macrocode} +% \begin{macrocode} +\def\ap@RV@Body{<?xml version="1.0"?><body % + xfa:APIVersion="Acrobat:9.5.5" % + xfa:contentType="text/html" % + xfa:spec="2.0.2" xmlns="http://www.w3.org/1999/xhtml" % + xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">} +\def\ap@RV@endBody{<body>} +% \end{macrocode} +% The implementation of rich text in a FreeText annotation is a little different from +% that of a rich text form field. We made some adjustments here for an annotation. +% \begin{macrocode} +\def\ap@sub#1{\rvorvstring{<span style="vertical-align:-0.0pt;">#1</span>}{#1}}% +\def\ap@sup#1{\rvorvstring{<span style="vertical-align:+0.0pt;">#1</span>}{#1}}% +\def\ap@uDec#1{\rt@amp\rt@hashtag#1;} +\def\ap@uHex#1{\rt@amp\rt@hashtag x#1;} +\def\ap@afterParaFont{% +% \end{macrocode} +% Cancel out certain attributes that are not used in annotation. +% \begin{macrocode} + \rt@formfieldfalse +} +\def\ap@afterFont{% + \rt@formfieldfalse + \let\rt@url\@empty +} +% \end{macrocode} +% \begin{environment}{textboxpara} +% \begin{macrocode} +\newenvironment{textboxpara}{% + \let\rt@sub\ap@sub\let\rt@sup\ap@sup + \let\rt@afterParaFont\ap@afterParaFont + \let\rt@afterFont\ap@afterFont + \def\rt@br{\rvorvstring{\rt@amp\rt@hashtag13;}{\string\r}}% + \def\rt@spc{\space}\let\uDec\ap@uDec\let\uHex\ap@uHex +}{} +% \end{macrocode} +% \end{environment} +% \begin{macro}{\annotpro} +% Here is the main command of this package, the first optional parameter +% are key-value pairs, as defined above; the second parameter is the content +% of the message. File attachments have not popup message, so the content +% becomes the description of the attachment in the attachments panel; hence, +% in this case, the length of the message should be short. +% \begin{macrocode} +\newcommand{\annotpro}{% + \begingroup +% \end{macrocode} +% Some of the stamp names begin with \texttt{\#}, the user must use +% \verb!\#! +% \begin{macrocode} + \let\#\ap@signalCustomAP + \@nnotpro +} +\newcommand{\@nnotpro}[1][]{% +% \end{macrocode} +% Increment a global counter, to count the annots as we create them. +% \begin{macrocode} + \global\advance\ap@annot@cnt1\relax +% \end{macrocode} +% Process options +% \begin{macrocode} + \setkeys{annotpro}{#1}% + \@nn@tpro +} +\newcommand{\@nn@tpro}[1] +{% +% \end{macrocode} +% See if there were any presets, if so, expand them, and apply +% \cs{setkeys} again. +% \begin{macrocode} + \ifx\annotpro@presets\@empty\else + \edef\ap@exp@tmp{\noexpand\setkeys{annotpro}{\annotpro@presets}}% + \ap@exp@tmp\fi +% \end{macrocode} +% If no type was specified, assume \texttt{Text}. +% \cs{setkeys} again. +% \begin{macrocode} + \ifx\ap@type\@empty\def\ap@type{Text}\def\ap@save@type{0}\fi +% \end{macrocode} +% Now get the value of the name parameter, permissible values depend +% on the stated \texttt{type}. +% \begin{macrocode} + \ifcase\ap@save@type\relax + \def\annot@subtype{annnotprotext}% + \ifx\annotpro@subject\@empty\def\annotpro@subject{Sticky Note}\fi + \ifx\annotpro@name\@empty\def\annotpro@name{Note}\fi + \def\ap@def@name{Note}\or + \ifx\annotpro@subject\@empty\def\annotpro@subject{Rubber Stamp}\fi + \def\annot@subtype{annnotprostamp}% + \def\ap@def@name{Draft}\or + \ifx\annotpro@subject\@empty + \def\annotpro@subject{File Attachment}\fi + \def\annot@subtype{annnotprofileattach}% + \def\ap@def@name{PushPin}\or + \ifx\annotpro@subject\@empty + \def\annotpro@subject{Text Box}\fi + \def\annot@subtype{annotprofreetext}% + \def\ap@def@name{FreeText}% + \fi +% \end{macrocode} +% Get the name! +% \begin{macrocode} + \edef\ap@exp@tmp{% + \noexpand\setkeys{\annot@subtype}{name=\annotpro@name}}% + \ap@exp@tmp\xdef\ap@def@type{\ap@type}% +% \end{macrocode} +% Encode text for contents, title, subject, and color; here \textsf{hyperref} +% commands are used. +% \begin{macrocode} + \let\annotpro@enc@contents\@empty +% \end{macrocode} +% \changes{v1.0b}{2012/11/10}{Included \cs{makespecialJS}} +% We'll use \cs{makespecialJS} here. +% \begin{macrocode} + \makespecialJS +% \end{macrocode} +% If this is a FreeText annot, we get the rich text and default style from \texttt{\#1}. +% Supported keys are richtext and defstyle. The values of these keys are names defined +% by \cs{setRVVContents} and \cs{setDefaultStyle}. If \texttt{defstyle} is not specified, we +% use \cs{useDefaultDS}. +% \begin{macrocode} +\if\ap@save@type\ap@freetext@type + \let\eq@RV@Body\ap@RV@Body\let\eq@RV@endBody\ap@RV@endBody + \setkeys{annotprofreetext}{#1}% + \ifx\annotpro@@ds\@empty + \def\ap@defaultstyle{\useDefaultDS}\else + \edef\ap@defaultstyle{\noexpand\useDS{\annotpro@@ds}}\fi + \ifx\annotpro@@rt\@empty + \let\annotpro@RC\@empty\let\annotpro@C\@empty\else + \edef\annotpro@RC{\noexpand\useRVContent{\annotpro@@rt}}% + \edef\annotpro@C{\noexpand\useVContent{\annotpro@@rt}}\fi +% \end{macrocode} +% If this is a FreeText annot, we define its rich and plain values; requires \pkg{richtext} package +% \begin{macrocode} +\else + \pdfstringdef\annotpro@enc@contents{#1}% +\fi + \let\annotpro@enc@title\@empty + \pdfstringdef\annotpro@enc@title{\annotpro@title}% + \let\annotpro@enc@subject\@empty + \pdfstringdef\annotpro@enc@subject{\annotpro@subject}% +% \end{macrocode} +% Color handling for \texttt{color}, \texttt{bgcolor}, and \texttt{bcolor} via \pkg{hycolor} package +% \begin{macrocode} + \HyColor@XZeroOneThreeFour{\annotpro@color}% + {\annotpro@enc@color}{annotpro}{color}% +\ifx\annotpro@bgcolor\@empty\else + \HyColor@XZeroOneThreeFour{\annotpro@bgcolor} + {\annotpro@enc@bgcolor}{annotpro}{bgcolor}\fi +\ifx\annotpro@bcolor\@empty + \edef\annotpro@bcolor{\annotpro@def@bcolor}\fi + \HyColor@FieldColor{\annotpro@bcolor} + {\annotpro@enc@bcolor}{annotpro}{bcolor}% +% \end{macrocode} +% Initialize some commands to be used later +% \begin{macrocode} + \let\ap@this@AP\@empty\let\ap@this@FS\@empty\let\ap@this@CA\@empty + \let\ap@this@Rotate\@empty +% \end{macrocode} +% See if opacity is requested, and set appropriate key. +% \begin{macrocode} + \ifx\annotpro@opacity\@empty\else + \def\ap@this@CA{/CA \annotpro@opacity}\fi +% \end{macrocode} +% Now, perform annotation specific tasks such as setting the +% bounding box. +% \begin{macrocode} + \ifcase\ap@save@type +% \end{macrocode} +% \textbf{Text annotation.} We use the pre-defined dimensions for +% these text icons, unless the user has specified \texttt{nohspace}, +% \texttt{novspace}, and \texttt{nospace}. If the name has not been +% specified, we use the default (\texttt{Note}). +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \edef\ap@thisWidth{\ifx\annotpro@hspace\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@hspace\fi}% + \edef\ap@thisHeight{\ifx\annotpro@vspace\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@vspace\fi}% +% \end{macrocode} +% \textbf{Stamp annotation.} This is a bit trickier, there are three +% cases: (1) the user references a standard stamp; (2) the user +% references a non-standard stamp, one that ships with Acrobat; (3) +% the user wants to create his own custom stamp using +% \textsf{graphicxsp} techniques. +% \begin{macrocode} + \or + \ifx\annotpro@@name\@empty + \ifx\ap@custom@name\@empty + \ifx\ap@customstamp@name\@empty +% \end{macrocode} +% Neither \texttt{name} nor \texttt{customStamp} was specified, so we assume the default. +% \begin{macrocode} + \ifx\annotpro@@name\@empty + \edef\annotpro@@name{\ap@def@name}\fi + \edef\ap@thisWidth{\standardStampWidth}% + \edef\ap@thisHeight{\standardStampHeight}% + \else +% \end{macrocode} +% Here the user wants a stamp using \textsf{graphicxsp} techniques. +% \begin{macrocode} + \if\ap@graphicxsp0\PackageError{annot_pro}% + {Specifying a custom name for a stamp requires + the graphicxsp package.}\fi + \ifx\annotpro@ap\@empty + \PackageError{annot_pro}{You must specify a value + for the ap key}\fi + \def\ap@ImageRef{\annotpro@ap\the\ap@cusstamp@cnt}% + \expandafter\ap@useStamp\expandafter{\annotpro@ap}% +% \end{macrocode} +% After making many experiments, there seems to be a need to +% reduce dimensions by \texttt{2bp} so that the desired dimensions +% are displayed through the user interface. There seems to +% be an 1bp border around all stamps. +% \begin{macrocode} + \edef\ap@thisWidth{\widthOf{\ap@ImageRef}bp}% + \@tempdima=\ap@thisWidth\advance\@tempdima-2bp + \edef\ap@thisWidth{\the\@tempdima}% + \edef\ap@thisHeight{\heightOf{\ap@ImageRef}bp}% + \@tempdima=\ap@thisHeight\advance\@tempdima-2bp + \edef\ap@thisHeight{\the\@tempdima}% + \def\ap@this@AP{/AP << /N {\ap@ImageRef} >>}% + \edef\annotpro@@name{% + \ap@signalCustomAP\ap@customstamp@name}% + \fi + \else +% \end{macrocode} +% The command \cs{ap@custom@name} is non-empty, so the user it trying +% to access a stamp on his own system. The user has indicated one of +% the stamps documented in the PDF Reference, these all have the same +% dimension +% +% For the bounding box, we use \cs{defaultStampWidth} by +% \cs{defaultStampHeight} as the dimensions, unless the values of +% \texttt{width} and/or \texttt{height} are specified. +% \begin{macrocode} + \edef\annotpro@@name{\ap@custom@name}% + \@ifundefined{ap@\ap@custom@name Width}{% + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \defaultStampWidth\else\annotpro@width\fi}% + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \defaultStampWidth\else\annotpro@height\fi}% + }{% + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@width\fi}% + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@height\fi}% + }% + \fi + \else +% \end{macrocode} +% This is the case of specifying one of the document stamps, as +% listed in the PDF Reference. +% \begin{macrocode} + \edef\ap@thisWidth{\standardStampWidth}% + \edef\ap@thisHeight{\standardStampHeight}% + \fi +% \end{macrocode} +% Let's use calc to allow for calculations on dimensions, +% with this, we can conveniently resize the box. +% \begin{macrocode} + \ifx\annotpro@scale\@empty + \ifx\annotpro@widthTo\@empty + \ifx\annotpro@heightTo\@empty\else % heightTo + \edef\ap@thisWidth{% + (\ap@thisWidth)*\noexpand + \ratio{\annotpro@heightTo}{\ap@thisHeight}}% + \edef\ap@thisHeight{\annotpro@heightTo}% + \fi + \else % widthTo + \edef\ap@thisHeight{% + (\ap@thisHeight)*\noexpand + \ratio{\annotpro@widthTo}{\ap@thisWidth}}% + \edef\ap@thisWidth{\annotpro@widthTo}% + \fi + \else %scale + \edef\ap@thisWidth{(\ap@thisWidth)*\noexpand + \real{\annotpro@scale}}% + \edef\ap@thisHeight{(\ap@thisHeight)*\noexpand + \real{\annotpro@scale}}% + \fi + \setlength{\@tempdima}{\ap@thisWidth}% + \edef\ap@thisWidth{\the\@tempdima}% + \setlength{\@tempdima}{\ap@thisHeight}% + \edef\ap@thisHeight{\the\@tempdima}% + \ifx\annotpro@rotate\empty\else + \def\ap@this@Rotate{/Rotate \annotpro@rotate}% + \ap@set@Rotate@BBox + \fi + \or +% \end{macrocode} +% \textbf{File Attachment annotation.} There are only a few icons for +% file attachments, and I've determined their dimensions using the user +% interface. So, we use those. +% +% If a name has not been specified, we use the default (\texttt{PushPin}). +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \ifx\annotpro@file\@empty\PackageError{annot_pro}% + {You must specify a path the file to be + attached using the file key.}\fi +% \end{macrocode} +% Set the \textbf{FS} key to specify the file. +% \begin{macrocode} + \def\ap@this@FS{/FS {apEmbedFile\the\ap@annot@cnt}}% + \edef\ap@thisWidth{\@nameuse{ap@\annotpro@@name Width}}% + \edef\ap@thisHeight{\@nameuse{ap@\annotpro@@name Height}}% + \ap@EmbedThisFile + \or +% \end{macrocode} +% \textbf{Free text annotation.} +% \begin{macrocode} + \ifx\annotpro@@name\@empty\edef\annotpro@@name{\ap@def@name}\fi + \ifx\annotpro@width\@empty\else + \setlength\@tempdima{\annotpro@width}% + \def\annotpro@width{\the\@tempdima}\fi + \edef\ap@thisWidth{\ifx\annotpro@width\@empty + \@nameuse{ap@\annotpro@@name Width}\else + \annotpro@width\fi}% + \ifx\annotpro@height\@empty\else + \setlength\@tempdima{\annotpro@height}% + \def\annotpro@height{\the\@tempdima}\fi + \edef\ap@thisHeight{\ifx\annotpro@height\@empty + \@nameuse{ap@\annotpro@@name Height}\else + \annotpro@height\fi}% + \fi +% \end{macrocode} +% if \texttt{margin} is specified, we insert a \cs{marginpar} here. +% \begin{macrocode} + \ifx\annotpro@margin\@empty\let\apmargintext\@empty + \expandafter\relax\else\expandafter\marginpar\fi +% \end{macrocode} +% Set the bounding box, and layout the annotation using the \textbf{pdfmark} operator. +% \begin{macrocode} + {\pdf@rect{\ap@Bbox{\ap@thisWidth}{\ap@thisHeight}}\literalps@out{% + [ \eq@objdef\ap@Rect + /F 4\ap@readonly + /Open \annotpro@open + /Title (\annotpro@enc@title) + /Subj (\annotpro@enc@subject) +% \end{macrocode} +% We have different set of keys for FreeText when for the other annotation types. +% \begin{macrocode} +\if\ap@save@type\ap@freetext@type +% \end{macrocode} +% The definitions of \cs{eq@RV@Body} and \cs{eq@RV@endBody} come from \pkg{richtext}, originally from +% \pkg{eforms}. The \psf{RC} and \psf{Contents} keys get their entries from \cs{annotpro@RC} and +% \cs{annotpro@C}, which are acquired from the \pkg{richtext} package. +% \begin{macrocode} + /RC(\eq@RV@Body\annotpro@RC\eq@RV@endBody) + /Contents (\annotpro@C) + /DS (\ap@defaultstyle) + \ifx\annotpro@bgcolor\@empty\else + /C [\annotpro@enc@bgcolor]\fi + /DA (\annotpro@enc@bcolor\space/Helv 12 Tf) + \ap@border@code +\else + /Open \annotpro@open + /Contents (\annotpro@enc@contents) + /Color [\annotpro@enc@color] +\fi +% \end{macrocode} +% \changes{v1.0a}{2011/07/14}{Changed the value of the \texttt{/Name} key.} +% Changed the value of \texttt{/Name} form a name to a string +% \begin{macrocode} + /Name (\annotpro@@name) + /Subtype/\ap@type + /NM (annotpro\the\ap@annot@cnt) + /M (D:\ap@pdfdate) + \ap@this@AP\ap@this@FS\ap@this@CA\ap@this@Rotate + /ANN pdfmark}\apmargintext}% + \to@insertStrucTabOrder{Annot}\endgroup +} +% \end{macrocode} +% \end{macro} +% When the user specifies the rotate key, we need to enlarge the +% bounding box so the stamp can be rotated within that box. +% \begin{macrocode} +\def\ap@set@Rotate@BBox{% + \CalculateSin\annotpro@rotate\CalculateCos\annotpro@rotate + \edef\c@cos{\UseCos\annotpro@rotate}% + \edef\c@sin{\UseSin\annotpro@rotate}% +% \end{macrocode} +% Determine the quadrant i or iii versus ii or iv +% \begin{macrocode} + \@tempdimb=\c@cos pt + \@tempdimb=\c@sin\@tempdimb + \let\ap@sign\@empty + \ifdim\@tempdimb<\z@\def\ap@sign{-}\fi +% \end{macrocode} +%What we are doing is calculating the \emph{smallest rectangle} whose sides are parallel +%to the horizontal and vertical, that contained the rotated stamp. We use this computed +%rectangle as the bounding rectangle of the rectangle. +% +%The basic algorithm is as follows: +% If the angle is in the first or third quadrant, we use +%\begin{align*} +% \text{width} &=\text{width}'\cos(\theta)+\text{height}'\sin(\theta)\\ +% \text{height} &=\text{width}'\sin(\theta)+\text{height}'\cos(\theta) +%\end{align*} +%else, we use +%\begin{align*} +% \text{width} &=-\text{width}'\cos(\theta)+\text{height}'\sin(\theta)\\ +% \text{height}&=\text{width}'\sin(\theta)-\text{height}'\cos(\theta) +%\end{align*} +% where, $\text{width}'$ and $\text{height}'$ are the original width and height of the bounding rectangle, +% and $\text{width}$ and $\text{height}$ are the new dimensions of the rectangle, after rotation through +% an angle of $\theta$. +% \paragraph*{Width calculation.} Width held in \cs{ap@temp@thisWidth}. +% \begin{macrocode} + \@tempdima=\ap@sign\ap@thisWidth + \@tempdima=\c@cos\@tempdima + \@tempdimb=\ap@thisHeight + \@tempdimb=\c@sin\@tempdimb + \advance\@tempdima by\@tempdimb + \edef\ap@temp@thisWidth{\the\@tempdima}% +% \end{macrocode} +% \paragraph*{Height calculation.} Final height held is \cs{@tempdima}. +% \begin{macrocode} + \@tempdima=\ap@thisWidth + \@tempdima=\c@sin\@tempdima + \@tempdimb=\ap@thisHeight + \@tempdimb=\c@cos\@tempdimb + \advance\@tempdima by\ap@sign\@tempdimb +% \end{macrocode} +% Any negative dimensions are changed to positive. +% \begin{macrocode} + \@tempdimb=\ap@temp@thisWidth\relax + \ifdim\@tempdimb<\z@\@tempdimb=-\the\@tempdimb\fi + \ifdim\@tempdima<\z@\@tempdima=-\the\@tempdima\fi +% \end{macrocode} +% Here are the final calculations, \cs{ap@thisWidth} and \cs{ap@thisHeight}. +% \begin{macrocode} + \edef\ap@thisWidth{\the\@tempdimb}% + \edef\ap@thisHeight{\the\@tempdima}% +} +% \end{macrocode} +% Some code for embedding a file in the PDF document. +% \begin{macrocode} +\def\ap@EmbedThisFile{% + \literalps@out{% + [ /_objdef {apEmbedFile\the\ap@annot@cnt}/type/dict/OBJ pdfmark + [ {apEmbedFile\the\ap@annot@cnt} << + /F (\ap@thisFileName) + /UF (\ap@thisFileName) + /EF << /F {apFileStream\the\ap@annot@cnt} >> + /Type/Filespec + >> /PUT pdfmark}% + \literalps@out{% + [ /_objdef {apFileStream\the\ap@annot@cnt}/type/stream/OBJ pdfmark + [ {apFileStream\the\ap@annot@cnt} (\annotpro@file) + (r) file /PUT pdfmark + [ {apFileStream\the\ap@annot@cnt} << + /Type/EmbeddedFile + >> /PUT pdfmark + [ {apFileStream\the\ap@annot@cnt} /CLOSE pdfmark}% +} +% \end{macrocode} +% Set global options for this package. +% \begin{macrocode} +\setAnnotOptions{title,subject,open=false,color} +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/annot-pro/annot_pro.ins b/texmf-dist/source/latex/annot-pro/annot_pro.ins new file mode 100644 index 00000000..db093b1d --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/annot_pro.ins @@ -0,0 +1,63 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2006 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2009/02/26} +\def\batchfile{annot_pro.ins} +% +% If you can assume that the target audience for the document all have +% Acrobat Reader 5.0 or later, then chance the following switch to true, +% else, leave it as false. + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate{% + \file{annot_pro.sty}{\from{annot_pro.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput diff --git a/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex b/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex new file mode 100644 index 00000000..167bc0ea --- /dev/null +++ b/texmf-dist/source/latex/annot-pro/doc/annotpro_man.tex @@ -0,0 +1,1120 @@ +% +% http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf +% +% makeindex < aebpro_man.idx > aebpro_man.ind +\documentclass[12pt]{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,tight*, + forcolorpaper,latextoc,extended}, + aebxmp,eforms,graphicxsp={showembeds} +]{aeb_pro} +\usepackage{array} +\usepackage{aeb_mlink} +%\usepackage{myriadpro} %[usecmtt] +\usepackage[altbullet]{lucidbry} +\usepackage{annot_pro} +\usepackage{richtext} + +\DeclareInitView +{% + layoutmag={mag=100}, +% windowoptions={fit} +} + +%\useAAXdimtrue + +\usepackage{makeidx} +\makeindex +\usepackage{acroman} + +\usepackage[active]{srcltx} + +\def\expath{../examples} + +\urlstyle{rm} +\def\pkg{\textsf} +\let\app\textsf +\let\opt\texttt +\let\uif\textsf +\let\env\texttt +\def\meta#1{\textit{\texttt{#1}}} +\def\ameta#1{$\langle\textit{\texttt{#1}}\rangle$} +\newdimen\aebdimen \aebdimen6pt %\partopsep \advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} +\def\SUB#1{\ensuremath{{}_{\text{#1}}}} + +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\amtIndent\leftmargini + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The \texorpdfstring{\textsf{annot\_pro} Package\\[1em]}{annot\textunderscore pro Package: } + Text, Stamp, File Attachment, and Text Box Annotations}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Documentation for annot\textunderscore pro from AcroTeX}, + talksite={\url{www.acrotex.net}}, + version={1.1b, 2016/10/18}, + keywords={sticky notes, stamps, file attachment text box, free text, annotations}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-40pt,fontsize=large,color=aeb} +\subsectionLayout{indent=-20pt,color=aeb} +\subsubsectionLayout{indent=0pt,color=aeb} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\embedEPS[hiresbb,transparencyGroup]{AdobeDon}{../examples/graphics/AdobeDon} + +\makeStamp{0.0 0.0 20.0 20.0}{AdobeDon}{% + [ 20 \widthOf{AdobeDon} div 20 \widthOf{AdobeDon} div scale {AdobeDon} /SP pdfmark +} + +\makeatletter +\def\setDisplayNumber#1#2{\kern0pt + \setlength\abovedisplayshortskip{0pt}% + \setlength\belowdisplayshortskip{0pt}% + \setlength\abovedisplayskip{0pt}% + \setlength\belowdisplayskip{0pt}% + \begin{equation}\label{#2}\end{equation}\kern0pt +} +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{5} +\renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}} +\renewcommand{\paragraph} + {\renewcommand{\@seccntformat}[1]{\theparagraph}% + \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\color{\aeb@subsubsectioncolor}\bfseries}} +\renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}} +\def\chgCurrLblName#1{\def\@currentlabelname{#1}} +\def\echgCurrLblName#1{\edef\@currentlabelname{#1}} +\makeatother + + +\setAnnotOptions{subject={AcroTeX Communiqu\'e},title={D.P. Story}} + +%\pagestyle{empty} +%\parindent0pt\parskip\medskipamount + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The annot_pro MANUAL"; +var manualfilename="Manual_BG_Print_annotpro.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); +\end{docassembly} +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\section{Introduction} + +This package is used to create text, stamp, and file attachment +annotations using \textbf{Adobe Distiller}, these annotations can be +viewed in Adobe Reader. For users of \textsf{pdf(la)tex}, use the +\textsf{pdfcomment} package by Josef Kleber.\footnote{Available at \href{http://ctan.org/pkg/pdfcomment}{ctan.org/pkg/pdfcomment}} + +The package primarily in support of my \href{http://www.math.uakron.edu/~dpstory} +{{Acro\negthinspace\TeX} PDF Blog}. I plan to use sticky notes, file attachments, and +custom stamps to make side-comments, and to provide source files. + +\section{Requirements} + +The requirements for your {\LaTeX} system, and well as any other +software, is highlighted in this section. + +\subsection{{\LaTeX} Package Requirements} + +The following packages, in addition to the standard {\LaTeX} +distribution, are required: +\begin{enumerate} + \item The \textsf{xkeyval} package is used to set up the key-value + pairs of the \cs{annot\-pro} command. Get a recent version. + \item The \textsf{xcolor} package is strongly recommended. + \item The \textsf{hyperref} package, a recent version. + \item If you want to create custom stamps (on the fly) using the techniques + developed for that purpose, the \textsf{graphicxsp} Package is required.\footnote + {Available at \href{http://ctan.org/pkg/graphicxsp}{ctan.org/pkg/graphicxsp}} +\end{enumerate} +The \textsf{annot\_pro} package is part of the \textcolor{blue}{AeB +Pro} family, which means \textbf{Adobe Distiller} is required. The +components of \textcolor{blue}{AeB} and \textcolor{blue}{AeB Pro} +are not required.\footnote{AeB: \href{http://ctan.org/pkg/acrotex}{ctan.org/pkg/acrotex}}${}^{,}$\footnote{AeB Pro: +\href{http://ctan.org/pkg/aeb-pro}{ctan.org/pkg/aeb-pro}} + +\subsection{PDF Creator Requirements} + +The \textsf{annot\_pro} package requires \textbf{Acrobat Distiller 5.0} (or +later) as the PDF creator. The document author typically uses dvips (or dvipsone) to +produce a PostScript file, which is then distilled to obtain a PDF. + +If you wish to use (dynamically) created stamps that have opacity less than 1, +you need to distill using \textbf{Standard\_transparancy.joboptions} with distiller, +in this case, \textbf{Acrobat Distiller 6.0} (or later) is required; otherwise, this +distiller job options file is not needed. + +The \textbf{Standard\_transparancy.joboptions} file is supplied with the \textsf{graphicxsp} +package; the documentation of the \textsf{graphicxsp} package includes installation instructions. + +\section{Installation} + +The installation is simple enough. Unzip \texttt{annot\_pro.zip} in a +folder that is on your {\LaTeX} search path. Refresh your filename +database, if appropriate. + +\begin{defineJS}{\winedtDist} +Run(|"c:\\Program Files\\Adobe\\Acrobat 9.0\\Acrobat\\acrodist.exe" -F "%P\\%N.ps"|,'%P',0,0,'%N.ps - Distiller',1,1); +\end{defineJS} + +\paragraph*{\textcolor{red}{Important:}} When creating a file attachment annotation, +you must specify a path to the file to be attached, and distiller must embed +this file. In recent versions of Acrobat, +security restrictions have been put in place to prevent +\textbf{Distiller} from reading files (the PostScript \textbf{file} +operator does not work). Fortunately, Distiller has a switch that +turns off this particular restriction. To successfully use this +package, therefore, you need to run Distiller by using the +\texttt{-F} command line switch. + + +Those using \app{Windows OS} can create a shortcut on the desktop, for example, +that starts \app{Distiller} with the \texttt{-F} switch. The \uif{Target} of the shortcut might read +\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] +"C:\Program Files (x86)\Adobe\ + Acrobat 9.0\Acrobat\acrodist.exe" -F +\end{Verbatim} +where we have wrapped the path to the next line to fit within the margins. +Once \app{Distiller} is started with \texttt{-F}, the switch remains in effect +until \app{Distiller} is closed. + +If this package is used to create file attachment annotations without the +\texttt{-F} switch, you typically get the following error message in +the Distiller log file +\begin{Verbatim}[xleftmargin=\leftmargini,fontsize=\small] +%%[ Error: undefinedfilename; OffendingCommand: file ]%% +\end{Verbatim} +This tells you that either you have not started Distiller with the +\texttt{-F} command line switch, or Distiller can't find one of the +files that the \textbf{file} operator was trying to read. + + + +\newtopic \textbf{Mac OS Users.} The above comments on the \texttt{-F} command line switch +is for Windows users, Mac OS users must choose the \texttt{AllowPSFileOps} user preference, this is located +in the \texttt{plist}, possibly located at +\begin{Verbatim}[fontsize=\small] +/Users/[User]/Library/Preferences/com.adobe.distiller9.plist +\end{Verbatim} +You can also use Spotlight, the search utility on Mac, to search for the string \texttt{com.adobe.distiller}; +the result might be +\begin{quote} +\texttt{com.adobe.distiller9.plist}.\footnote{In the case of Adobe Distiller, version 9.0} +\end{quote} +Clicking on this find, +Spotlight opens \texttt{com.adobe.distiller9.plist} in the \texttt{plist} editor, see \hyperref[plist]{Figure~\ref*{plist}}. +If necessary, click on the arrow next to the Root to expand the +choices, then click the up and down arrows at the far +right in the \texttt{AllowPSFileOps} row to select Yes as the value. +\begin{figure}[hbt]\setlength{\fboxsep}{0pt} +\begin{center} +\fbox{\includegraphics[width=.75\linewidth]{plistEditor}} +\caption{com.adobe.distiller9.plist}\label{plist} +\end{center} +\end{figure} + +\section{The \texorpdfstring{\protect\cs{annotpro}}{\CMD{annotpro}} Command} + +The main command of this package is \Com{annotpro}; the command is controlled by +its optional parameters. The same command can create a text annotation (sticky note), +a stamp annotation, a file attachment or a Free Text (Text Box) annotation. The syntax of this command is +\bVerb\takeMeasure{\string\annotpro[\ameta{KV-pairs}]\darg{\ameta{text}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\annotpro[!ameta(KV-pairs)]{!ameta(text)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:arbproCmd} +\end{minipage}\end{minipage}\eVerb +\PD The optional argument is one or more key-value pairs that describe the +annotation; the required argument, \ameta{text}, is the ``contents'' of the +annotation; for the text and stamp annotation, \ameta{text} becomes the +contents of the popup annotation, for a file attachment annotation, which has +not associated pop-up, it is the description of the file attachment that +appears in the file attachment panel of Adobe Reader. In the latter case, the +value of \ameta{text} should be rather short. The key-value pairs (\ameta{KV-pairs}) are +described over the next few sections. + +\paragraph*{\color{red}Sample files.} The sample files \texttt{annots.tex} and \texttt{textbox.tex} illustrate the features +of the \pkg{annotpro} package. + +\subsection{Key-values common to all annotations}\label{s:CommonKeys} + +The following are key-value pairs common to all annotations. + +\begin{itemize} + \item \texttt{type=\ameta{\upshape{text|stamp|fileattachment|textbox}}} The \texttt{type} key determines the type of annotation to be produced; + permissible values are \texttt{text}, \texttt{stamp}, and \texttt{fileattachment}. This + key is optional, if not present, \texttt{type=text} is assumed. + \item \texttt{name=\ameta{name}} The name of the icon to use for the declared \texttt{type}. Permissible + values are dependent on the \texttt{type}, and are discussed in subsequent sections. + \item \texttt{title=\ameta{text}} Text to be displayed in the title bar of the annotation's pop-up window + when open and active. By convention, this entry identifies the user who made the annotation, + though any (short) text may be used. You can use \cs{setAnnotOptions} to globally set + the title of each annotation, perhaps using your name. +\begin{Verbatim}[fontsize=\small] + \setAnnotOptions{title={D. P. Story}} +\end{Verbatim} + \item \texttt{subject=\ameta{text}} Text representing a short description of the subject of the annotation. + You can use \cs{setAnnotOptions} to globally set the subject of each annotation, +\begin{Verbatim}[fontsize=\small] + \setAnnotOptions{title={D. P. Story}, + subject={AcroTeX Communiqu\'e}} +\end{Verbatim} + \item \texttt{color}: The color of the title bar of the pop-up window of the annotation. + \item \texttt{readonly=\ameta{\upshape{true|false}}} Set the annotation to readonly. The user can click on the annot to + see the popup, but the user, if using Acrobat, cannot move the annotation around on the page. + The popup window can still be move by the user. (This property makes no difference to the + user of Adobe Reader.) + \item \texttt{opacity=\ameta{dec}}: The opacity value ($ + \text0\le\text{\ameta{dec}}\le\text1$) to be used in painting the (icon of + the) annotation, but does apply to the pop-up window. The default + is 1.0. + \item[] Adobe Distiller handles the opacity for us in all cases except when we create a (dynamic) stamp. + If an opacity value less than 1 is desired, special techniques are needed, and the file needs to + be distilled using the \textbf{Standard\_tranparency} job options. + +\end{itemize} +The following key-values are {\LaTeX} based concerning placement of the annotation in the margin. +\begin{itemize} + \item \texttt{margin}: Use this key (it has no value), to declare that you want the annotation + to appear in the margin. The \cs{marginpar} command from core {\LaTeX} is used, the placement + of the annotation follows the rules set down by {\LaTeX}. You can reverse the placement of the + annotation by using the {\LaTeX} command \cs{reversemarginpar} (annots placed in the right margin, and now placed in the left); + you can return to the default by using \cs{normalmarginpar}. + + \item[] Given that you have use the \texttt{margin} key, there is an associated key that can be used, as well + as a command. + \begin{itemize} + \item \texttt{margintext}: The value of this key is text that will be typeset just below the annotation icon. + \item \cs{marginpartextformat}: A {\LaTeX} command for + formatting the text in the margin, the default definition is\smallskip +\begin{Verbatim} +\margintextformat{\bfseries\tiny\color{blue}} +\end{Verbatim} + \end{itemize} + \item[] For an annotation placed in the margin with margin text, you might want to use the \texttt{readonly} + key, this prevents the user---even one using Acrobat---from moving the annotation away from its caption. +\end{itemize} +The following key-value is for your convenience. +\begin{itemize} + \item \texttt{presets}: A key to allow the introduction of pre-defined options, for example, + you might like all your comment annotations to be red, so you can define +\begin{verbatim} + \def\myComments{type=text,name=Comment,color=red} +\end{verbatim} +then say +\begin{verbatim} + \annotpro[presets=\myComment]{Way to go!} +\end{verbatim} +Additional options may be included, +\begin{verbatim} + \annotpro[presets=\myComment,margin]{Way to go!} +\end{verbatim} +for example. + +\end{itemize} + +\subsection{Key-values for text annotations} + +The position of the annotation is determined by its bounding rectangle; for the +text annotation, an icon is placed so that its upper left corner is at the upper +left corner of the bounding rectangle. The icons themselves have certain dimensions +that have been recorded within the \texttt{annot\_pro} package, so you need not worry +about leaving space for them. + +An important fact about the icons used by text annotation is that they \emph{do not zoom in or out} as the page +magnification is changed; furthermore, the graphics commands \cs{scalebox} and \cs{resizebox} do not rescale +the icons as expected. + +The following are options specific to the text annotation. Recall, the text annotation +is of \texttt{type=text}. +\begin{itemize} + \item \texttt{name}: The name of the icon to use when displaying this annotation in closed form (no pop-up window visible). + Possible values---as specified in the \textsl{PDF Reference}---are + \texttt{Comment}, \texttt{Key}, \texttt{Note}, \texttt{Help}, + \texttt{NewParagraph}, \texttt{Paragraph}, and \texttt{Insert}. + Additional icons that are available in recent versions of Adobe + Reader are +\begin{quote}\raggedright + \texttt{Check}, \texttt{Circle}, \texttt{Cross}, \texttt{Star}, \texttt{RightArrow}, \texttt{RightPointer}, + \texttt{UpArrow}, \texttt{UpLeftArrow} +\end{quote} + If you are using comments in your document, and your audience have + older versions of Adobe Reader, it is best to use only the seven + listed in the \textsl{PDF Reference}. + + \item \texttt{open}: A Boolean value that determines whether the pop-up + window is open or not. When \texttt{true} the pop-up is open. The + package default is \texttt{false}. You can use \cs{setAnnotOptions} + to set this option globally. + + \item \texttt{nohspace}, \texttt{novspace}, \texttt{nospace}: The + presence of these commands zeroes out the dimension(s) of the + bounding rectangle. Specifying \texttt{nohspace} as an option + causes the icon to take up no horizontal space as the page is + latexed. Here\annotpro[nohspace]{This a sticky note with the + nospace option} is an example of a sticky note with the + \texttt{nohspace} option. Without any of these three keys, the text + annotation \annotpro[type=text,name=Key]{A sticky note that takes + up TeX space. If you put the document into 100\% magnification, + you'll see the note fits precisely into the allotted space.} fits + exactly into the allotted space at + \setLinkText[\A{\JS{this.zoom=100;}}\Color{0 .6 0}]{100\% + magnification}, try it. + + When the icon takes up no {\TeX} space, it may cover content on + the page, as it does above. Acrobat users can move the icon + around, but AR users cannot move the icon. The pop-up window is + movable and scalable, but the icon cannot be moved. Therefore, + you must be careful about placement. + + Additional positioning of the icons can be made using standard {\LaTeX} + commands such as \cs{raisebox} and \cs{smash}. For example,\smash{\raisebox{1in}{\annotpro[nospace,color=blue,opacity=.25]{I've raised this annot by 1in. + I've also used the nospace key, the icon does not take up any TeX space.}}} the blue icon above was created by +\begin{Verbatim}[fontsize=\footnotesize] + For example,\smash{\raisebox{1in}\raisebox{1in}{% + \annotpro[nospace,color=blue, + opacity=.25]{...clever message...}}} +\end{Verbatim} +Note that I've set the \texttt{opacity} to .25. + +\end{itemize} + + +\subsection{Key-values for stamp annotations} + +A stamp annotation is similar to a text annotation in the sense that +it has a pop-up window in which the contents of the message is +displayed; however, unlike the text annotation icons, the stamp +appearance by be re-scaled using \cs{scalebox} and \cs{resizebox} of +the graphics package; however, the keys \texttt{scale}, +\texttt{widthTo}, and \texttt{heightTo}, as described below, are the +recommended methods of re-scaling a stamp. + +The following are the key-values associated with this annotation type. + +\begin{itemize} + +\begingroup\raggedright + + \item \texttt{name}: The stamps listed in the \textsl{PDF + Reference} are \texttt{Approved}, \texttt{AsIs}, + \texttt{Confidential}, \texttt{Departmental}, \texttt{Draft}, + \texttt{Experimental}, \texttt{Expired}, \texttt{Final}, + \texttt{ForComment}, \texttt{ForPublicRelease}, + \texttt{NotApproved}, \texttt{NotForPublicRelease}, + \texttt{Sold}, and \texttt{TopSecret}. If \texttt{name} + is not specified, \texttt{Draft} is the default.\par\endgroup + + \item[] There are other stamps, not listed in the \textsl{PDF + Reference}, but available in more recent versions of Acrobat. + The file \texttt{stamps.pdf} lists all the stamps that I have + access to. The names of these other stamps are recognized by the + \texttt{name} key. + + \item[] The dimensions of the stamps listed above are all the + same, they are \texttt{150bp} width and \texttt{40bp} high. + + \item[] Additional stamps are shipped by Acrobat, a listing of these + appears in the file \texttt{stamps.pdf} (\texttt{stamps.tex}). + + \item\texttt{width}, \texttt{height}: If the value of + \texttt{name} key is something other than one of the stamps + listed above (one of the stamps listed in the file + \texttt{stamps.pdf}), the width and height are not known to + \textsf{annot\_pro}. In this case, use the \texttt{height} and \texttt{width} keys + to set the dimensions of the bounding box. Adobe Distiller will + resize the stamp to the stamp is the largest one that can fit in + the bounding box, the stamp will be centered vertically and + horizontally within the bounding box. + + \item[] Here are a couple of examples, the bounding box is should as a black \cs{fbox}. + +\begin{itemize} + +\previewtrue + + \item This one \annotpro[type=stamp,name=SBApproved,widthTo=106bp,color=webbrown]{This package just got better!} + fits more or less exactly. I determined the dimensions of this stamp through some controls of the user interface. + Contrast this this stamp + \annotpro[type=stamp,width=50bp,height=50bp,name=SBApproved,color=webbrown]{This package just got better!} + obtained by setting \texttt{width=50bp} and \texttt{height=50bp}. Notice the ``best fit,'' and that the bounding + box takes up space. We can use \cs{smash} to smash its vertical height, let's see how that looks, + \smash{\annotpro[type=stamp,width=50bp,height=50bp,name=SBApproved,color=webbrown]{This package just got better!}} + +\smallskip + +\begin{defineJS}{\annotstampi} +Exact fit: +\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!} +\end{defineJS} +\begin{defineJS}{\annotstampii} +Bad rectangle, but stamp fits the best it can: +\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!} +\end{defineJS} + +\previewfalse + + \item[] The code for producing these stamps are given in the margins. + \annotpro[margin,readonly,margintext={\centering Good Fit}]{\annotstampi}% + \annotpro[margin,readonly,margintext={\centering Bad Fit}]{\annotstampii}% + +\begin{defineJS}{\annotstampiii} +Resize using \\resizebox. \\raisebox was used to lift the same up a little: +\\raisebox{4pt}{\\resizebox{.5in}{!}{\\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!}}} +\end{defineJS} + + \item[] You can resize these stamps using \cs{scalebox} and \cs{resizebox}, like so. + \raisebox{4pt}{\resizebox{.5in}{!}{\annotpro[type=stamp,name=SBApproved,color=webbrown]{This package just got better!}}} + \enspace The code for producing this stamp are given here \annotpro{\annotstampiii}. + +\begin{defineJS}{\annotstampiv} +\smash{\makebox[0pt][l]{\annotpro[type=stamp,name=Approved,color=blue]{I give my stamp of approval!}}} +\end{defineJS} + +\item To create a stamp\smash{\makebox[0pt][l]{\annotpro[type=stamp,name=Approved,color=blue]{I give my stamp of approval!}}} that takes up no space, it is easiest to use \cs{smash} and \verb!\makebox[0pt][l]{text}!; + here is one of the standard stamps as listed in the \textsl{PDF Reference}. The code for this stamp is given + in this note \annotpro{\annotstampiv}. +\end{itemize} + +\item[] Try changing the magnification of the page, you'll see that stamps are re-scaled as you zoom in or out, while +the text annotations are not. I don't like text annotations for this reason. + +\begin{defineJS}{\annotstampv} +\\annotpro[type=stamp,customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{This is the best picture of me ever taken. Akron, about 2005.} +\end{defineJS} + +\item\texttt{rotate}: Stamps can be rotated, use this key to enter an angle of rotation, for example, + \texttt{rotate=30} rotates the stamp $\text{30}^\circ$ counter clock-wise. + +\item[\textcolor{red}{\ding{043}}] Do not use the \cs{rotatebox} command of \textsf{graphics} package, +this command \emph{does not rotate} the stamp. + +\item \texttt{scale}: Use this key to re-scale the stamp; the value of this key is a number between + 0 and 1. For example, \texttt{scale=.5} reduces both width and height in half. +\item \texttt{widthTo}: This key resizes the stamp so that the width is the value of this key; for example, + \texttt{widthTo=2in} re-scales the stamp to have a 2in width. +\item\texttt{heightTo}: This key resizes the stamp so that the height is the value of this key; for example, + \texttt{heightTo=2in} re-scales the stamp to have a 2in height. + +\item[] Only one of the keys \texttt{scale}, \texttt{widthTo}, and \texttt{heightTo} are recognized + for any stamp annotation. If all three are specified, only \texttt{scale} is used. If + \texttt{widthTo} and \texttt{heightTo} are both specified, then \texttt{widthTo} is used. + +\item[\textcolor{red}{\ding{043}}] The use of these keys is the recommend way of re-scaling +a stamp. These methods are compatible with the \texttt{rotate} key. + +\item \texttt{customStamp}: You can create a custom stamp from any + image you wish to use, here is + \annotpro[type=stamp,customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{This + is the best picture of me ever taken. Akron, about 2005.} one such + example. The code for the above stamp is given here + \annotpro{\annotstampv}. + +\item \texttt{ap}: When the \texttt{\texttt{customStamp}} key is + used, you have to supply an indirect reference to the appearance of + the stamp. This reference is made through the \texttt{ap} key. The + example above demonstrates the use of the \texttt{ap} key. +\end{itemize} +\textbf{\textcolor{red}{Important:}} When using the stamps of +\app{Acrobat} always perform a \uif{SaveAs} on the file when you have finished +building the file. This imports the appearances of the stamps into +the document and saves them. + +\redpoint The creation of a custom stamp requires detailed list of steps, at +some point I'll write a white paper on the subject.\footnote{Use the \pkg{mkstmp} package +(\href{http://ctan.org/pkg/mkstmp}{ctan.org/pkg/mkstmp}), +details of how to create custom stamps are included in the documentation.} + +\begin{defineJS}{\approvedStmp} +\\annotpro[type=stamp,name=Approved,widthTo=2in,rotate=30]{...} +\end{defineJS} + +\newtopic +Here's an example of the keys \texttt{rotate} and \texttt{widthTo}: +\begin{center} + \annotpro[type=stamp,name=Approved,widthTo=2in,rotate=30]{The source for this + stamp is ...\string\r\approvedStmp} +\end{center} + +\subsection{Key-values file attachment annotations} + +The file attachment annotation has no pop-up window, the value of the required parameter is used as a description +of the attached file, and appears in the file attachment window. + +The key-value pairs special to this type of annotation are as follows. + +\begin{itemize} + \item\texttt{name}: The name of the icon to use, permitted values are + \texttt{Graph}, \texttt{Paperclip}, \texttt{PushPin}, and \texttt{Tag}. If the value of name is not + specified, the default is \texttt{PushPin}. The annot\_pro package knows the dimensions of each of these + icons, so you need not worry about them. They can be re-scale using standard commands from the graphics package, + though, there may be little need of doing so. + \item \texttt{file}: The value of the file key is the \emph{absolute path} to the file to be attached. I've + devised a helper command \Com{defineAPath} that can be used to define the path to your file. For example, we can + define a path to wherever the files are, like so +\begin{Verbatim}[fontsize=\footnotesize] + \defineAPath{\graphicsPath} + {C:/Users/Public/Documents/My TeX Files/% + tex/latex/aeb/aebpro/annot_pro/examples/graphics} +\end{Verbatim} +\item[] The command takes two arguments, the name of the command to be defined, and the path. + +\defineAPath{\graphicsPath}{C:/Users/Public/Documents/My TeX Files/tex/latex/aeb/aebpro/annot_pro/examples/graphics} + +\begin{defineJS}{\fa} +\\annotpro[type=fileattachment,file={\graphicsPath/AdobeDon.pdf},name=Paperclip]{The author of annot\_pro (ho, ho).} +\end{defineJS} + +\item[] We can create a file attachment + \annotpro[type=fileattachment,file={\graphicsPath/AdobeDon.pdf},name=Paperclip]{The + author of annot\_pro (ho, ho).} like so, ho, ho. Here is the code + for this file attachment \annotpro[name=Star]{\fa}. Clicking the + file attachment icon will open the file, in recent versions of + Acrobat, the file is listed in the file attachments panel. Open it + using the user interface, and you'll see the file listed, as well + as a description, as passed to the annot as the second argument of + \cs{annotpro}. +\end{itemize} + +The file attachment icons can be resized using any of the graphics commands, \cs{scalebox} or \cs{resizebox}. + +\subsection{The \texorpdfstring{\protect\uif{Text Box}}{Text Box} + (\texorpdfstring{\protect\uif{Free Text}}{Free Text}) annotation} + +A \uif{Text Box} annotation is a rectangular region in which the user can +enter rich text. The annotation may be created and `pre-populated' with rich text from a +{\LaTeX} source through the \pkg{annot\_pro} package. + +The \uif{Text Box} annotation, as implemented by this package, requires the +\pkg{richtex} package, dated 2016/09/30 or later. A one simple method for +introducing \pkg{richtext} is through the \opt{useTextBox} option of +\pkg{annot\_pro}. Placing the following line in the preamble: +\begin{Verbatim}[xleftmargin=\amtIndent] +\usepackage[useTextBox]{annot_pro} +\end{Verbatim} +declares you are going to use \uif{Text Box} annotations. The option does +nothing more than to execute \cs{usepackage\darg{richtext}[2016/09/30]}. The +option is more of a convenience. + +To create a \uif{Text Box} (originally named \uif{Free Text}) annotation use the \cs{annotpro} command. +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}{3.5in} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[xleftmargin=\leftmargini,commandchars=!(),fontsize=\small] +\annotpro[!textbf(type=textbox),!ameta(KV-pairs)] + {richtext=!ameta(name),defstyle=!ameta(name)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:textbox} +\end{minipage}\end{minipage}\eVerb +Notice the second argument is not \ameta{text} as it is with the other annotations, but consists +of key-value pairs; recognized keys are \texttt{richtext} and \texttt{defstyle}. + +\newtopic\noindent The sample file \texttt{textbox.tex} illustrates the features of this section. + +\subsubsection{Creating an empty \texorpdfstring{\protect\uif{Text Box}}{Text Box}} + +A common application would be to create an empty \uif{Text Box} for the +document consumer to type in comments. Below is an example of a \uif{Free +Text} annotation, called \uif{Text Box} by the user-interface of +\app{Acrobat}/\app{Adobe Reader}. +\begin{flushleft} %\previewtrue +\begin{minipage}{2in} +\annotpro[title=dpstory,type=textbox,subject=Empty Text Box]{} +\end{minipage}\hfill +\begin{minipage}{\linewidth-2in-10pt}\small +Press \uif{Ctrl+E} (\app{Windows}) or \uif{Cmd+E} (\app{Mac OS}) to obtain +the \uif{Properties} toolbar, now click on the text box to obtain the +\uif{Text Box Properties} toolbar. Double clicking on the text box +brings up the \uif{Text Box Text Properties} toolbar. +\end{minipage} +\end{flushleft} +The verbatim listing of the above \uif{Text Box} is, +\begin{Verbatim}[xleftmargin=\leftmargini] +\annotpro[type=textbox, + title=dpstory,subject=Empty Text Box]{} +\end{Verbatim} +The required second argument is empty, which leads to an empty \uif{Text Box}. + +\subsubsection{Creating a non-empty \texorpdfstring{\protect\uif{Text Box}}{Text Box}} + +A much more interesting exercise is to pre-populate the \uif{Text Box} with rich text for the +document consumer to read and/or to respond. + +\paragraph[Steps to create rich text content]{Steps to create rich text content.}\chgCurrLblName{Steps to create rich text content}\label{para:StepsRC} +We briefly outline the techniques to create rich text +for a \uif{Text Box} annotation. +\begin{itemize} + \item Use the \env{textboxpara} environment and the \cs{rtpara} command + to declare your rich text paragraph. +\bVerb\takeMeasure{\string\rtpara[\ameta{KV-pairs}]\darg{\ameta{name\SUB{para}}}\darg{\ameta{rich-content}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\begin{textboxpara} +\rtpara[!ameta(KV-pairs)]{!ameta(name!SUB(para))}{!ameta(rich-content)} +... +\end{textboxpara} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:rtpara} +\end{minipage}\end{minipage}\eVerb +Details of the \cs{rtpara} command are found in the documentation manual of +the \pkg{richtext} package. The \env{textboxpara} environment is needed for +certain redefinitions of internals because of the different way rich text +is supported and implemented in the \uif{Text Box} annotation verses the +rich text field. + +\item Use the \cs{setRVVContent} command on your \cs{rtpara}-declared rich text and give it +a name \ameta{name\SUB{rvvc}}. +\bVerb\takeMeasure{\string\setRVVContent\darg{\ameta{name\SUB{rvvc}}}\darg{\ameta{name\SUB{para}}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\setRVVContent{!ameta(name!SUB(rvvc))}{!ameta(name!SUB(para))} +... +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:setRVVC} +\end{minipage}\end{minipage}\eVerb +This command expands the paragraph named \ameta{name\SUB{para}} and +develops the rich text version and the plain text version. It is +\ameta{name\SUB{rvvc}} that is used as a value for the \opt{richtext} key +above and illustrated below. To reduce the number of names, you can use +the same name for \ameta{name\SUB{rvvc}} as for \ameta{name\SUB{para}} +(\cs{setRVVContent\darg{para1}\darg{para1}}). + +The rich text \emph{form field} supports multiple paragraphs, and richer +formatting options than the \uif{Text Box} annotation. Of importance is +that the \uif{Text Box} annotation only permits a \emph{single paragraph}. + +\item (Optional) Declare a (named) default style using \cs{setDefaultStyle}: +\bVerb\takeMeasure{\string\setDefaultStyle\darg{\ameta{name\SUB{ds}}}\darg{\ameta{KV-pairs}}}% +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!()] +\setDefaultStyle{!ameta(name!SUB(ds))}{!ameta(KV-pairs)} +... +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:setDefStyle} +\end{minipage}\end{minipage}\eVerb +This default style is assignment a name that is used as the value of the +\opt{defstyle} key mentioned earlier, and illustrated below. If a value for +\opt{defstyle} is not provided, a standard default style is used. + +\end{itemize} +Once the \cs{rtpara}-declared paragraphs have been made and their names have passed through +\cs{setRVVContent}, you are ready to create a \uif{Text Box} annotation. + +\paragraph[Key-values for second argument]{Key-values for second argument.}\chgCurrLblName{Key-values for second argument}\label{para:KV2ndArg} +The required second argument, refer to display~\eqref{display:textbox}, has +two keys, both of which are optional. You are encouraged to read the +documentation for the \pkg{richtext} package for greater understanding of the +descriptions and examples found below. +\begin{description} + \item[\texttt{richtext=\ameta{name\SUB{rvvc}}}] The \opt{richtext} key + is the way the rich text is passed to the \uif{Text Box}. The + \ameta{name\SUB{rvvc}} is declared by the \cs{setRVVContent} + command. Use the command \cs{rtpara} within the \env{textboxpara} + environment to define the actual rich text paragraph. For example, +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \bf{rich text}!} +\end{textboxpara} +\setRVVContent{myContent}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{!textbf(richtext=myContent)} +\end{Verbatim} +The above code produces the following \uif{Text Box}: +\begin{quote} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \bf{rich text}!} +\end{textboxpara} +\setRVVContent{myContent}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=myContent} +\end{quote} + + \item[\texttt{defstyle=\ameta{name\SUB{ds}}}] Through the + \opt{defstyle} you can define set the default style (refer to the + documentation of the \pkg{richtext} package. If this key does not + appear, then a predefined default style is provided. +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif}, + color=0000FF} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \it{rich text}!} +\setRVVContent{para1}{para1} +\end{textboxpara} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=para1,!textbf(defstyle=myDS)} +\end{Verbatim} +Notice that we've used the name `\texttt{para1}' for both \cs{setRVVContent} +and \cs{rtpara}. The above code produces the following \uif{Text Box}: +\begin{flushleft}%\previewtrue +\begin{minipage}{2in} +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif},color=0000FF} +\begin{textboxpara} +\rtpara{para1}{\span{color=FF0000}{Hello world}, + this is \it{rich text}!} +\end{textboxpara} +\setRVVContent{para1}{para1} +\annotpro[type=textbox,title=dpstory, + subject=Text Box]{richtext=para1,defstyle=myDS} +\end{minipage}\hfill +\begin{minipage}{\linewidth-2in-10pt}\small +Press \uif{Ctrl+E} (\app{Windows}) or \uif{Cmd+E} (\app{Mac OS}) to +obtain the \uif{Properties} toolbar, now double click on the text box to +obtain the \uif{Text Box Text Properties} toolbar to verify the font used +is indeed Myriad Pro. +\end{minipage} +\end{flushleft} +\end{description} +If you are at all interested in generating the \uif{Text Box} annotation using rich text +strings, you are encouraged to read the documentation on \pkg{richtext}, +there you will learn about all the key-values available to format the text +and the paragraph. + +The \pkg{richtext} package was written for rich text form fields, but applies +to rich text annotations as well; however, it should be noted that there are +differences between forms and text box annotations in how they handle rich +text. One of the major differences is that rich text annotations (\uif{Text +Box}) \emph{do not support} multiple paragraphs as form fields do; as a +result, features listed in the \uif{Paragraph} and \uif{Link} tabs of the +\uif{Form Field Text Properties} dialog box are not available for the +\uif{Text Box}. + +\paragraph[Keys \& commands inherited from the \texorpdfstring{\protect\pkg{richtext}}{richtext} package]% +{Keys \& commands inherited from the \pkg{richtext} package.}% +\chgCurrLblName{Keys \& commands inherited from the \pkg{richtext} package}\label{para:InheritedKeys} +The following keys are supported by the \uif{Text Box} annotation: +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}[c]{4in} +\xdef\panelWidth{\the\linewidth}% +\begin{quote}\raggedright +\opt{font}, \opt{size}, \opt{\st{raise}}, \opt{ulstyle}, +\opt{color}, \opt{\st{url}}, \opt{style}, \opt{\st{raw}}, \opt{halign} +\end{quote} +\end{minipage}\hfill +\begin{minipage}[c]{\linewidth-\panelWidth} +\setDisplayNumber\label{display:suppKeys} +\end{minipage}\end{minipage}\eVerb +The following commands are supported: +\bVerb\begin{minipage}{\linewidth} +\begin{minipage}[c]{4in} +\xdef\panelWidth{\the\linewidth}% +\begin{quote}\raggedright +\cs{span}, \cs{br}, \cs{it}, \cs{bf}, \cs{sup} and \cs{sub} +\end{quote} +\end{minipage}\hfill +\begin{minipage}[c]{\linewidth-\panelWidth} +\setDisplayNumber\label{display:suppCmds} +\end{minipage}\end{minipage}\eVerb +The ones having an overstrike are supported in a rich text \emph{form field}, but +not within an \uif{Text Box}. Refer to the documentation of the +\pkg{richtext} for details of these keys and commands. In this document, we +illustrate by example. + +\paragraph[Key-values of \texorpdfstring{\protect\cs{rtpara}}{\textbackslash{rtpara}}]{Key-values of \cs{rtpara}.}% +\chgCurrLblName{Key-values of \cs{rtpara}}\label{para:KeysPara} The +keys of display~\eqref{display:suppKeys} -- excluding the overstrike ones -- may be used in the +\ameta{KV-pairs} argument of \cs{rtpara} of display~\eqref{display:rtpara}. + +\paragraph[Permissible commands within \texorpdfstring{\protect\ameta{rich-content}}{<rich-content>}]{% +Permissible commands within \ameta{rich-content}.}\chgCurrLblName{Permissible +commands within \ameta{\ameta{rich-content}}}\label{para:KeysCmdsRC} The +\ameta{rich-content} argument of display~\eqref{display:rtpara} (normally) +consists of Latin 1 characters, plus any markup in the form of the commands +listed in display~\eqref{display:suppCmds}. +\begin{itemize} + \item \cs{span} has two arguments, more on this command in the paragraph below + titled \Nameref{para:Span}. + \item \cs{br} is a line break, it has no argument. + \item \cs{it} is italic font; it has one argument, the text to be + placed in italics: \cs{it\darg{this is italic}}. + \item \cs{bf} is bold font; it has one argument, the text to be placed in bold: + \cs{bf\darg{this is bold}}. + + \cs{it} and \cs{bf} may be nested: \cs{it\darg{\cs{bf\darg{bold and italic}}}}. + + \item \cs{sup} and \cs{sub} are superscript and subscript, respectively; they each + have one argument, the text to be raised or lowered. For example, + \verb~We can \sup{raise} or we can \sub{lower} text~. +\end{itemize} +The above markups, with the exception of \cs{span} are illustrated below. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{mypara}{\\it{This is italic}, whereas \\bf{this is bold}, but wait, we can do +\\it{\\bf{bold and italic}}.\\br\\br Moving on, we can \\sup{raise} or we can \\sub{lower} text.} +\\end{textboxpara} +\\setRVVContent{mypara}{mypara} +\\annotpro[type=textbox,width=3.5in]{richtext=mypara} +\end{defineJS} +\begin{quote} +\begin{textboxpara} +\rtpara{mypara}{\it{This is italic}, whereas \bf{this is bold}, but wait, we can do +\it{\bf{bold and italic}}.\br\br Moving on, we can \sup{raise} or we can \sub{lower} text.} +\end{textboxpara} +\setRVVContent{mypara}{mypara} +\annotpro[type=textbox,width=3.5in]{richtext=mypara}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +The verbatim listing for this example is in the sticky note in the margin. + +\paragraph[Some comments on the \texorpdfstring{\protect\cs{span}}{\textbackslash{span}} +command]{Some comments on the \cs{span} command.}\chgCurrLblName{Some comments on the \cs{span} command}\label{para:Span} +the \cs{span} command, defined only locally within the \ameta{rich-text} argument \cs{rtspan} is a general purpose +command to format text. It has two argument: +\begin{quote} +\cs{span\darg{\ameta{KV-pairs}}\darg{\ameta{text}}}. +\end{quote} +The \ameta{KV-pairs} argument can be the keys of +display~\eqref{display:suppKeys} (again excluding the overstrike keys). The \ameta{text} argument is the +text to be made rich; experience shows that \cs{it}, \cs{bf}, \cs{sub} and \cs{sup} may be used within +\ameta{text}. Italic and bold may be accomplished using the \opt{style} key, probably preferred over +using \cs{it} and \cs{bf} within \ameta{text}. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{Welcome to my \\span{style={strikeit,bold}}{poor}\\span{style=bold}{rich text world}. +We add a little color shall we try \\span{color=FF0000}{red} or \\span{color=00FF00}{green}?\\br\\br +There are several styles of underlining \\span{ulstyle=ul}{basic underlining}, +\\span{ulstyle=2ul}{double underlining}, \\span{ulstyle=wul}{word underlining}, and +\\span{ulstyle=2wul}{double word underlining}. Cool.} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1} +\end{defineJS} +\begin{quote} +\begin{textboxpara} +\rtpara{para1}{Welcome to my \span{style={strikeit,bold}}{poor}\span{style=bold}{rich text world}. +We add a little color shall we try \span{color=FF0000}{red} or \span{color=00FF00}{green}?\br\br +There are several styles of underlining \span{ulstyle=ul}{basic underlining}, +\span{ulstyle=2ul}{double underlining}, \span{ulstyle=wul}{word underlining}, and +\span{ulstyle=2wul}{double word underlining}. Cool.} +\end{textboxpara} +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +The verbatim listing for this example is in the sticky note in the margin. + +\paragraph[Key-values of \texorpdfstring{\protect\cs{setDefaultStyle}}{\textbackslash{setDefaultStyle}}]% +{Key-values of \cs{setDefaultStyle}.}% +\chgCurrLblName{Key-values of \cs{setDefaultStyle}}\label{para:KeysDS} The +keys of display~\eqref{display:suppKeys} -- excluding the overstrike ones -- +may be used in the \ameta{KV-pairs} argument of \cs{setDefaultStyle} of +display~\eqref{display:setDefStyle}; however, only the keys \opt{font}, +\opt{size}, \opt{color}, and \opt{halign} are typically used. For example, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars=!()] +\setDefaultStyle{myDS}{font={'Myriad Pro',sans-serif}, + size=12.0,color=0000FF,halign=left} +\end{Verbatim} +The name `\opt{myDS}' may then be used as the value of \opt{defstyle} key in the second argument +of \cs{annotpro}, see display~\eqref{display:textbox}. + +\subsubsection{Key-values for text box annotations} + +\hyperref[s:CommonKeys]{Section~\ref*{s:CommonKeys}} lists keys that are +common to all annotations; we list the ones that make sense for the \uif{Text +Box} annotation, and strikeout these that do not: +\begin{quote}\raggedright +\texttt{type}, \texttt{\st{name}}, \texttt{title}, \texttt{subject}, +\texttt{\st{color}}, \texttt{readonly}, \texttt{opacity}, \texttt{margin}, +\texttt{presets} +\end{quote} +In addition to these keys, there are several keys particular to the text box +annotation. We list these and describe them in detail. +\begin{itemize} + \item \texttt{width=\ameta{length}}: The width of the annotation, the + default is \texttt{144bp} (\texttt{2in}). + \item \texttt{height=\ameta{length}}: The height of the annotation, the + default is \texttt{72bp} (\texttt{1in}). + \item \texttt{bgcolor=\ameta{color}} The color to be used as the background color + of the text box annotation. If \opt{bgcolor} has no value, transparent color is used. + The default is white. + \item \texttt{bcolor=\ameta{color}} The color to be used as the boundary color of the + annotation. The default is black. + \item \texttt{borderstyle=\ameta{choice}}: This keys determines the + style of border to be used. It is a choice key, choices are + \texttt{none}, \texttt{solid}, \texttt{dash1}, \texttt{dash2}, + \texttt{dash3}, \texttt{dash4}, \texttt{dash5}, \texttt{dash6}, + \texttt{cloud1}, and \texttt{cloud2}. The default is \texttt{solid}. + \item \texttt{borderwidth=\ameta{choice}}: The border width of the + annotation, acceptable choices are \texttt{.5}, \texttt{1}, \texttt{2}, + \texttt{3}, \texttt{4}, \texttt{6}, 8, and \texttt{10}. The default is \texttt{1}. +\end{itemize} +\begin{textboxpara} +\rtpara{para1}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=14bp*2, bgcolor=cornsilk, +bcolor=blue]{richtext=para1}}}\setRVVContent{para1}{para1} +\rtpara{para2}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=16bp*3, bgcolor, bcolor=red, +borderstyle=dash2, borderwidth=2]{richtext=para2}}}\setRVVContent{para2}{para2} +\rtpara{para3}{\cs{annotpro[type=textbox, width=\cs{linewidth}, height=18bp*3, bcolor=red, +borderstyle=cloud1]{richtext=para3}}}\setRVVContent{para3}{para3} +\end{textboxpara}%\previewtrue +\setDefaultStyle{myDS}{font=Courier,size=12.0,color=000000} +\annotpro[type=textbox, width=\linewidth, height=14bp*2, bgcolor=cornsilk, bcolor=blue]{richtext=para1,defstyle=myDS}\\[6bp] +\annotpro[type=textbox, width=\linewidth, height=16bp*3, bgcolor, bcolor=red, borderstyle=dash2, borderwidth=2]{richtext=para2,defstyle=myDS}\\[6bp] +\annotpro[type=textbox, width=\linewidth, height=18bp*3, bcolor=red, borderstyle=cloud1]{richtext=para3,defstyle=myDS}\\[6bp] +The second text box annotation above has transparent background color. Using your pointing device, move it around to verify +the background is `see through', compare with the other two by moving them around, not `see through'. + +\subsubsection{Accented glyphs and the unicode characters} + +There are several advantages that text box annotation have over rich text +form fields: movability and unicode. An annotation can be moved around the +page by the user quite easily, a form field typically cannot unless the user +is using \app{Acrobat}. Also, when it comes to using unicode, text box +annotations are far superior to rich text form fields. Unicode characters may +be inserted using the convenience commands \cs{uHex} and \cs{uDec}, where the +first take a hex code as its argument and the second takes a non-negative +integer as its argument. Latin1 accented characters can be entered using octal notation +for example, \verb~J\374rgen~ +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{J\\374rgen is a nice fellow, though I've never met him.\\br\\br +We've communicated, J\\uHex{00FC}rgen and I, via email. J\\uDec{252}rgen where are you?} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4.5in,height=14bp*7]{richtext=para1} +\end{defineJS} +\begin{textboxpara} +\rtpara{para1}{J\374rgen is a nice fellow, though I've never met him.\br\br +We've communicated, J\uHex{00FC}rgen and I, via email. J\uDec{252}rgen where are you?} +\end{textboxpara} +\begin{quote}%\previewtrue +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4in,height=16bp*4]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +But wait, we're not done. In theory, we can access any unicode character through the use +of \cs{uHex} or \cs{uDec}. I'll randomly pick off some unicode characters. +\begin{defineJS}{\annotextboxi} +\\begin{textboxpara} +\\rtpara{para1}{% +\\uHex{01A2}, \\uHex{023E}, \\uHex{03A3}, \\uHex{0416}, +\\uHex{0583}, \\uHex{06A6}, \\uHex{263A}, \\uHex{FB21}, +\\uHex{82A0}, \\uHex{4EE4}, \\uHex{F92C}, \\uHex{5475}} +\\end{textboxpara} +\\setRVVContent{para1}{para1} +\\annotpro[type=textbox,width=4in,height=14bp*2]{richtext=para1} +\end{defineJS} +\begin{textboxpara} +\rtpara{para1}{% +\uHex{01A2}, \uHex{023E}, \uHex{03A3}, \uHex{0416}, +\uHex{0583}, \uHex{06A6}, \uHex{263A}, \uHex{FB21}, +\uHex{82A0}, \uHex{4EE4}, \uHex{F92C}, \uHex{5475}} +\end{textboxpara} +\begin{quote}%\previewtrue +\setRVVContent{para1}{para1} +\annotpro[type=textbox,width=4in,height=14bp*2]{richtext=para1}% +\annotpro[margin,readonly,margintext={\centering The Code}]{\annotextboxi}% +\end{quote} +Cool! + + +\subsection{Setting Global Options with + \texorpdfstring{\protect\cs{setAnnotOptions}}{\CMD{setAnnotOptions}}} + +Global options are by using the \cs{setAnnotOptions} command. +In the preamble of this document I placed +\begin{Verbatim}[fontsize=\footnotesize] +\setAnnotOptions{subject={AcroTeX Communiqu\'e},title={D.P. Story}} +\end{Verbatim} +That way, I didn't have to constantly type in my personal name for each example. These options can be overwritten +by specifying options locally, if I say, \cs{annotpro[author=Don Story]\darg{Hi there!}}, the author is now my +alter ego, Don Story. + +%\redpoint\textbf{\textcolor{red}{Important:}} Certain key, \texttt{name}, should not be used to set global options, +%\cs{setAnnotOptions} tests for these, and puts them back to their default values that are expected +%by \cs{annotpro}. These keys should only be used for passing options to \cs{annotpro} in its option list. + + +\bigskip +\noindent +That's all for now, I simply must get back to my retirement. \dps\space\annotpro[type=stamp, + customStamp=MyDPSImage,ap=AdobeDon,color=webbrown]{% + Did I say that I had to get back to my retirement?} + +\end{document} diff --git a/texmf-dist/source/latex/graphicxsp/graphicxsp.dtx b/texmf-dist/source/latex/graphicxsp/graphicxsp.dtx new file mode 100644 index 00000000..0f01eea6 --- /dev/null +++ b/texmf-dist/source/latex/graphicxsp/graphicxsp.dtx @@ -0,0 +1,1037 @@ +%\iffalse +%<*copyright> +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% graphicxsp.sty package, 2007-08-14 %% +%% Copyright (C) 2007 D. P. Story %% +%% storyd@owc.edu / dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%</copyright> +%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%<package>\ProvidesPackage{graphicxsp} +%<package> [2016/02/19 v1.0 Graphicxsp: Extension of graphicx for dvips/dvipsone (dps)] +%<*driver> +\documentclass{ltxdoc} +\usepackage[colorlinks,hyperindex]{hyperref} +%\pdfstringdefDisableCommands{\let\\\textbackslash} +%\EnableCrossrefs \CodelineIndex +\begin{document} + \GetFileInfo{graphicxsp.sty} + \title{\textsf{GraphicxSP}: Re-using EPS files} + \author{D. P. Story\\ + Email: \texttt{dpstory@acrotex.net} \& \texttt{storyd@owc.edu}} + \date{processed \today} + \maketitle + \tableofcontents + \let\Email\texttt + \DocInput{graphicxsp.dtx} + \PrintIndex +\end{document} +%</driver> +% \fi +% \MakeShortVerb{|} +% \StopEventually{} +% +% \DoNotIndex{\def,\edef,\gdef,\xdef,\global,\long,\let} +% \DoNotIndex{\expandafter,\string,\the,\ifx,\else,\fi} +% \DoNotIndex{\csname,\endcsname,\relax,\begingroup,\endgroup} +% \DoNotIndex{\DeclareTextCommand,\DeclareTextCompositeCommand} +% \DoNotIndex{\space,\@empty,\special} +% +% \begin{macrocode} +%<*package> +% \end{macrocode} +% +% \section{Introduction} +% +% \textsf{GraphicxSP} is a patch into the \textsf{graphicx} package so that users of \textsf{dvips} and +% \textsf{dvipsone}, using distiller, can insert and re-use \texttt{.eps} figures. +% \begin{macrocode} +% \end{macrocode} +% +% \section{Package Options} +% +% \begin{macro}{preview} +% \begin{macro}{dvipsone} +% \begin{macro}{dvips} +% \begin{macro}{showembeds} +% This package recognizes three options: driver names \texttt{dvips} (the default), +% \texttt{dvipsone} (old YandY \TeX) and a \texttt{preview}. +% \texttt{dvipsone}, using distiller, can insert and re-use \texttt{.eps} figures. +% \begin{macrocode} +\@ifundefined{ifpreview}{\newif\ifpreview\previewfalse}{} +\DeclareOption{preview}{\previewtrue} +\DeclareOption{dvipsone}{\def\gxsp@drivernum{0}} +\DeclareOption{dvips}{\def\gxsp@drivernum{1}} +\DeclareOption{showembeds}{\let\gxsp@showembeds=0} +\let\gxsp@showembeds=1 +\def\gxsp@drivernum{1} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{draft} +% \begin{macro}{final} +% \begin{macro}{shownonames} +% The \texttt{draft} mode passes \texttt{draft} on to \textsf{graphicx}. The images +% appear as rectangles, with the name of the image. The \texttt{shownonames} option +% removes the name inside the rectangle. +% \changes{v.7b}{2012/09/11}{Added \texttt{draft}, \texttt{final}, \texttt{shownonames} options} +% \begin{macrocode} +\DeclareOption{draft}{\spxGin@drafttrue + \PassOptionsToPackage{draft}{graphicx}} +\DeclareOption{final}{\spxGin@draftfalse + \PassOptionsToPackage{final}{graphicx}} +\DeclareOption{shownonames}{\@spx@shownameindraftfalse} +\newif\if@spx@shownameindraft \@spx@shownameindrafttrue +\newif\ifspxGin@draft \spxGin@draftfalse +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macrocode} +\InputIfFileExists{graphics.cfg}{}{} +\ProcessOptions +\@ifundefined{eq@driver@name}{}{% +% \end{macrocode} +% As a point of personal convenience, if \cs{eq@driver@name}, which is +% defined in \textsf{web}, and the name is \texttt{dvipsone}, we'll override +% the default of \texttt{dvips}. +% \begin{macrocode} +\def\DVIPSONE{dvipsone}\ifx\eq@driver@name\DVIPSONE +\def\gxsp@drivernum{0}\fi} +% \end{macrocode} +% +% \section{Package Requirements} +% +% We minimally require the \textsf{graphicx} package, which we patch +% into, and the \textsf{eso-pic}, package, which, in turn, requires +% the \textsf{everyshi} package. +% \begin{macrocode} +\RequirePackage{graphicx} +\ifspxGin@draft\Gin@drafttrue\fi +\RequirePackage{eso-pic} +\RequirePackage{verbatim} +% \end{macrocode} +% +% \section{PostScript and Driver Dependent Definitions} +% +% Hyperref is not required, but if present, we'll use its code, otherwise, we use +% code from hyperref to hide in-line images from GhostScript's view. +% \begin{macrocode} +\def\grcxsp@hideEPS{\AtBeginDvi{\special{!% +/product where{% +pop +product(Distiller)search{% + pop pop pop + userdict + /?pdfmark /exec load put% +}{% +pop +userdict + begin + /?pdfmark /pop load def + end +}ifelse% +}if% +}}} +\@ifpackageloaded{hyperref}{\let\grcxsp@hideEPS\relax}{\grcxsp@hideEPS} +% \end{macrocode} +% We use either \textsf{dvips} or \textsf{dvipsone} as the driver, in both cases the following is +% the special we shall use. +% \begin{macrocode} +\def\gxsp@literalps@out#1{\special{ps:#1}} +% \end{macrocode} +% The following are driver dependent definitions. We begin with \texttt{dvips}. +% +%\paragraph*{Dvips driver.} +% \begin{macrocode} +\ifnum\gxsp@drivernum=1\relax +% \end{macrocode} +% When the driver is \texttt{dvips}, we define some postscript procedures to +% making conversions between {\TeX} and PDF. +% \begin{macrocode} +\special{!userdict begin + /TeXtoPDF {65536 div DVImag mul} def % sp to pts + /PDFtoDvips {72.27 div Resolution mul} def % points to dots + /PDFtoVDvips {72.27 div VResolution mul} def % points to dots + /DvipstoPDF {72.27 mul Resolution div} def % dots to points + /HTeXtoDvips {TeXtoPDF PDFtoDvips} def % sp to dots + /VTeXtoDvips {TeXtoPDF PDFtoVDvips} def end} % sp to dots +% \end{macrocode} +% The \texttt{cstr} is used to calculate the lower left corner of the the bounding +% box of an \textsf{EPS} file for \texttt{dvips}. +% \begin{macrocode} +\special{!userdict begin /cstr {currentpoint translate + 1 PDFtoDvips DVImag mul -1 PDFtoDvips DVImag mul scale}def end} +\def\gxsp@setPSCoor{cstr } +\def\b@grxsp@Literal{userdict begin} +\def\e@grxsp@Literal{end} +\else +% \end{macrocode} +%\paragraph*{Dvipsone driver.} The following is code special to the \textsf{dvipsone} driver. +% +% The \texttt{undsclx} is used to calculate the lower left corner of the the bounding +% box of an \textsf{EPS} file for \texttt{dvipsone}. +% \begin{macrocode} +\def\gxsp@setPSCoor{undsclx } +\let\b@grxsp@Literal\@empty +\let\e@grxsp@Literal\@empty +\fi +% \end{macrocode} +% These are procedures that support the dynamic naming of \verb!/_objdef!. Distiller +% crashes if any symbolic reference name is not unique. So we must protect distiller. +% \texttt{grcxspObjDef} takes a single argument on the operand stack +%\begin{verbatim} +% (<name>) grcxspObjDef +%\end{verbatim} +% and leaves at the top of the stack \verb!(<name>)graphicxspCnt-currentpage)! +% \begin{macrocode} +\special{!\b@grxsp@Literal + /currentpage 0 def + /graphicxspCnt 0 def + /graphicxspStr 10 string def + /graphicxspMergeStr {2 copy length exch length add string dup dup + 4 3 roll 4 index length exch putinterval 3 1 roll exch + 0 exch putinterval} def + /grcxspObjDef { + /graphicxspCnt graphicxspCnt 1 add def + currentpage graphicxspStr cvs graphicxspMergeStr + (-) graphicxspMergeStr + graphicxspCnt graphicxspStr cvs + graphicxspMergeStr +% dup (Creating _objdef ) exch (\string\n) graphicxspMergeStr +% graphicxspMergeStr print flush + } def \e@grxsp@Literal +} +% \end{macrocode} +% +% \section{Messing with \textsf{eso-pic}} +% +% One of the problems was to embed \textsf{EPS} files within a +% \textbf{BP}/\textbf{EP} operator pair. The solutions was to use +% \textsf{eso-pic}, place each graphic at the lower left corner of +% the page. We define a new ``Hook'' for \textsf{eso-pic} and attach +% it to \cs{@ShipoutPicture}. +% \begin{macrocode} +\def\ESO@AeBip@Hook{} +\newcommand{\AddToEmbeddedEPSs}{\g@addto@macro\ESO@AeBip@Hook} +% \end{macrocode}% +% We redefine \cs{@ShipoutPicture} command of \textsf{eso-pic} so +% that the embedded figures are placed before \texttt{ESO@HookI} and +% \texttt{ESO@HookII}, for the case that someone wants to use placed +% pictures for a background, the file must be embedded before they +% can be inserted. +% \begin{macrocode} +\@ifundefined{@ShipoutPicture}{% +% \end{macrocode} +% The new version of eso-pic does not define \cs{@ShipoutPicture}, so we +% use some of the new code. +% \begin{macrocode} + \ESO@isMEMOIR{% + \AtBeginShipout{% + \@tempdima=-\trimedge + \advance\@tempdima-\paperwidth + \advance\@tempdima\stockwidth + \if@twoside\ifodd\c@page\else + \advance\@tempdima2\trimedge + \advance\@tempdima\paperwidth + \advance\@tempdima-\stockwidth + \fi\fi + \@tempdimb=\ESO@yoffsetI + \advance\@tempdimb-\trimtop + \nointerlineskip + \AtBeginShipoutUpperLeft{% + \put(\LenToUnit{\@tempdima},\LenToUnit{\@tempdimb}){% + \ESO@HookIII\ESO@HookI\ESO@HookII + \global\let\ESO@HookII\@empty + }% + }% + } + }{% + \AtBeginShipout{% + \nointerlineskip + \AtBeginShipoutUpperLeft{% + \put(0,\LenToUnit{\ESO@yoffsetI}){% + \ESO@HookIII\ESO@AeBip@Hook\ESO@HookI\ESO@HookII% dps + \global\let\ESO@HookII\@empty + \global\let\ESO@AeBip@Hook\@empty% dps + }% + }% + } + } +}{% +% \end{macrocode} +% If \cs{@ShipoutPicture} is defined, we use the old code. +% \begin{macrocode} + \renewcommand{\@ShipoutPicture}{% + \bgroup + \@tempswafalse% + \ifx\ESO@HookI\@empty\else\@tempswatrue\fi% + \ifx\ESO@HookII\@empty\else\@tempswatrue\fi% + \ifx\ESO@HookIII\@empty\else\@tempswatrue\fi% + \ifx\ESO@AeBip@Hook\@empty\else\@tempswatrue\fi%dps(08/16/07) + \if@tempswa% + \@tempdima=1in\@tempdimb=-\@tempdima% + \advance\@tempdimb\ESO@yoffsetI% + \ESO@isMEMOIR{% + \advance\@tempdima\trimedge% + \advance\@tempdima\paperwidth% + \advance\@tempdima-\stockwidth% + \if@twoside\ifodd\c@page\else% + \advance\@tempdima-2\trimedge% + \advance\@tempdima-\paperwidth% + \advance\@tempdima\stockwidth% + \fi\fi% + \advance\@tempdimb\trimtop}% + \unitlength=1pt% + \global\setbox\@cclv\vbox{% + \vbox{\let\protect\relax + \pictur@(0,0)(\strip@pt\@tempdima,\strip@pt\@tempdimb)% + \ESO@HookIII\ESO@AeBip@Hook\ESO@HookI\ESO@HookII%dps + \global\let\ESO@HookII\@empty% + \global\let\ESO@AeBip@Hook\@empty% %dps + \endpicture}% + \nointerlineskip% + \box\@cclv}% + \fi + \egroup + } +} +% \end{macrocode} +% \begin{macrocode} +\AddToShipoutPicture{\special{ps: /currentpage \thepage\space def}} +% \end{macrocode} +% +% \section{Useful Supporting Commands} +% +% Some standard code that I use in AeB to wrote verbatim tex to a file. +% \begin{macrocode} +\def\verbatimwrite{\@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatim@out + {\the\verbatim@line}}% + \verbatim@start +} +\def\endverbatimwrite{\@esphack} +\def\gxsp@IWVO{\immediate\write\verbatim@out} +\def\x@namedef#1{\expandafter\xdef\csname #1\endcsname} +\def\e@namedef#1{\expandafter\edef\csname #1\endcsname} +% \end{macrocode} +% Below is a counter to insure each name is unique. It is used +% in \cs{Ginclude@eps@SP}. +% \begin{macrocode} +\newcount\grxsp@cnt \grxsp@cnt=0 +% \end{macrocode} +% \section{The Main Section} +% +% In this section we define two commands for the user, \cs{embedEPS} and +% \cs{insertEPS}, defined additional keys for the \textsf{graphicx} package, and +% consequently, hook into the \cs{includegraphics} command. +% +% Some helper commands to save the dimensions of the pictures as +% they are embedded using \cs{embedEPS}. +% \begin{macrocode} +\def\grcxsp@setPictureDimen#1#2#3#4#5{% + \x@namedef{#1Gin@llx}{#2}\x@namedef{#1Gin@lly}{#3}% + \x@namedef{#1Gin@urx}{#4}\x@namedef{#1Gin@ury}{#5}% + \x@namedef{#1BBox}{#2 #3 #4 #5}% + \begingroup +% \end{macrocode} +% Calculate the width and height of the EPS. If the lower-left corner +% is not (0,0), results may not be predictable. +% \begin{macrocode} + \@tempdima=#4bp + \advance\@tempdima-#2bp + \@tempdima=.99626\@tempdima + \x@namedef{#1widthOf}{\strip@pt\@tempdima}% + \@tempdima=#5bp + \advance\@tempdima-#3bp + \@tempdima=.99626\@tempdima + \x@namedef{#1heightOf}{\strip@pt\@tempdima}% + \endgroup +} +% \end{macrocode} +% \begin{macro}{\heightOf} +% \begin{macro}{\widthOf} +% \begin{macro}{\llxOf} +% \begin{macro}{\llyOf} +% \begin{macro}{\urxOf} +% \begin{macro}{\uryOf} +% More helper commands for calculating the height, width and path of +% an embedded file. These can be used by the user, that's you. +% \begin{macrocode} +\def\heightOf#1{\csname#1heightOf\endcsname} +\def\widthOf#1{\csname#1widthOf\endcsname} +\def\bboxOf#1{\csname#1BBox\endcsname} +\def\llxOf#1{\csname#1Gin@llx\endcsname} +\def\llyOf#1{\csname#1Gin@lly\endcsname} +\def\urxOf#1{\csname#1Gin@urx\endcsname} +\def\uryOf#1{\csname#1Gin@ury\endcsname} +% \end{macrocode} +% Other internal commands that save info. +% \begin{macrocode} +%\def\grcxsp@pathOf#1{\csname#1path\endcsname} +%\def\grcxsp@importSF#1{\csname#1importScaleFactor\endcsname} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% We redefine a command from \textsf{graphics}. When testing the \texttt{draft} option, +% we had some problems with an underscore |\_| in the value of the \texttt{name} key, +% so we sanitize this character. +% \begin{macrocode} +%\def\spx@sanitize{\catcode`\_=12\relax} +%\def\Gin@i{% +% \@ifnextchar[%] +% {\spx@sanitize\Gin@ii} +% {\Gin@bboxfalse\Ginclude@graphics}} +% \end{macrocode} +% \begin{macro}{\embedEPS} +% This is the command for embedding an \textsf{EPS} file in the document for use +% by the \textbf{SP} operator. The command takes three arguments, one of which is +% optional +%\begin{enumerate} +% \item[]\makebox[0pt][r]{\texttt{[\#1]}: }Recognizes two key-value pairs (1) \texttt{hiresbb}, +% this is the same key-value used by the \textsf{graphicx} package; (2) \texttt{transparencyGroup}, +% a new option for creating a transparency group. Using \texttt{transparencyGroup} without +% any value will make the embedded graphic into a transparency group, with a value adds +% additional keys as documented in the \textsl{PDF Reference}. +% \item[]\makebox[0pt][r]{\texttt{\#2}: }A symbolic name for the embedded graphic, this name is used +% by distiller. +% \item\makebox[0pt][r]{\texttt{\#3}: }path to the \texttt{EPS} file (without extension). +%\end{enumerate} +% I prefer the \cs{embedEPS} commands to appear in the preamble, but they can appear anywhere +% before the first appearance of \cs{includegraphics} or \cs{insertEPS} that reference the +% embedded file. I suppose this embedding could have been automatic at the first occurrence +% of \cs{includegraphics} or \cs{insertEPS}, but I didn't go that route. +% \begin{macrocode} +\newcommand{\embedEPS}[3][]{% + \@ifundefined{#2Gin@llx}{}{% + \PackageError{graphicxsp}% + {The name, #2, on line \the\inputlineno\MessageBreak + is already defined. All embedded graphics\MessageBreak + must be assigned a unique name} + {Give this embedded graphic a unique name.}% + }% + \begingroup + \let\Gin@transparencygroup\@empty +% \end{macrocode} +% We use the \textsf{graphicx} command \cs{Gread@eps} to verify that +% the graphic exists, and if so, get its bounding box parameters. We +% work only with \texttt{.eps} files so let's add the extension. +% \begin{macrocode} + \let\input@path\Ginput@path + \filename@parse{#3.eps}% + \Gin@getbase{.eps}% + \@ifundefined{Gin@base}{% + \PackageError{graphicxsp}% + {% + Graphics file #3 specified on \the\inputlineno\MessageBreak + was not found% + }{% + Verify the file exists, is an eps file,\MessageBreak + is on the latex search path, or is in the\MessageBreak + current directory.% + }% + }{}% + \e@namedef{gxsp@Gin@base}{\Gin@base}% + \Gread@eps{\gxsp@Gin@base.eps}% +% \end{macrocode} +% Now set the keys. We delayed the \cs{setkeys} because \texttt{name=\#2} would +% set the switch \verb!\if@Ginnamed! to \texttt{true}, which has consequences +% on computing the \cs{Gin@base} when \cs{Gin@setfile} is executed. +% \begin{macrocode} + \setkeys{Gin}{name=#2,#1}% +% \end{macrocode} +% Once the file is found and the bounding box parameters are recorded by +% \textsf{graphicx}, we save these under the graphic's embedded symbolic name. +% \begin{macrocode} + \grcxsp@setPictureDimen% + {\Gin@name}{\Gin@llx}{\Gin@lly}{\Gin@urx}{\Gin@ury}% +% \x@namedef{\Gin@name path}{#3}% +% \end{macrocode} +% If an embedded graphic exceeds the boundaries of +% the paper size, the graphic is clipped off. What I am doing below +% is determining the largest scale factor, +% \cs{gxsp@embedSF}, needed to embed the file without +% exceeding the page boundaries. +% \begin{macrocode} + \def\gxsp@embedSF{1}% + \@tempdima=\Gin@urx bp + \advance\@tempdima-\Gin@llx bp + \ifdim\@tempdima>\paperwidth + \Gscale@div\gxsp@embedSF\paperwidth\@tempdima + \@tempdima=\Gin@ury bp + \advance\@tempdima-\Gin@lly bp + \@tempdima=\gxsp@embedSF\@tempdima + \ifdim\@tempdima>\paperheight + \edef\gxsp@embedSFSave{\gxsp@embedSF}% + \Gscale@div\gxsp@embedSF\paperheight\@tempdima + \@tempdima=\gxsp@embedSFSave\p@ + \@tempdima=\gxsp@embedSF\@tempdima + \edef\gxsp@embedSF{\strip@pt\@tempdima}% + \fi + \else + \@tempdima=\Gin@ury bp + \advance\@tempdima\Gin@lly bp + \ifdim\@tempdima>\paperheight + \Gscale@div\gxsp@embedSF\paperheight\@tempdima + \fi + \fi +% \end{macrocode} +% Now that we have \cs{gxsp@embedSF}, we add the current graphic to our +% collection of embedded files using \cs{AddToEmbeddedEPSs}, +% which is a variation on \cs{AddToShipoutPicture}, but uses +% \cs{ESO@AeBip@Hook} for our private use. We expand some of the +% arguments before executing \cs{AddToEmbeddedEPSs}. +% \begin{macrocode} + \edef\@tempa{% + \noexpand\AddToEmbeddedEPSs{\noexpand\AtPageLowerLeft% + {\noexpand\scalebox{\gxsp@embedSF}% + {\noexpand\gxsp@embedEPS{\gxsp@Gin@base}{\Gin@name}}}% + \noexpand\AtPageCenter{\noexpand\gcxsp@wrapEmbeddedFigure% + {\Gin@transparencygroup}{#2}{\Gin@transparency}}}}\@tempa + \endgroup +} +\@onlypreamble{\embedEPS} +% \end{macrocode} +% In a dvi previewer, the embedded graphics are visible on the first page. +% The \cs{grcxsp@coverEmbeds} puts a white color box over the graphics, +% {\LaTeX} content and other graphics are placed over this white color box. +% The white color box can be removed with the \texttt{showembeds} option. +% \begin{macrocode} +\def\grcxsp@coverEmbeds{% + \AddToEmbeddedEPSs{\AtPageLowerLeft{\colorbox{white}{% + \parbox[b][\paperheight]{\paperwidth}{\hfill\vfill}}}}} +\if\gxsp@showembeds1% +\AtBeginDocument{\grcxsp@coverEmbeds} +\else +\let\grcxsp@coverEmbeds\relax +\fi +% \end{macrocode} +% \end{macro} +% \begin{macro}{\gxsp@embedEPS} +% The \cs{gxsp@embedEPS} command embeds the file, and is called +% by \cs{embedEPS}. It takes three options: (1) the value of +% \texttt{transparencyGroup}; (2) the \textsf{EPS} path; and (3) the +% symbolic name for the graphic. +% +% The bounding box \texttt{/BBox} acts as a clipping path, if the graphic +% falls outside the box, it is clipped off. Since we don't know the size of +% the graphic in advance, and the value of the \verb!%%BoundingBox! can be +% deceiving, set the of \texttt{/BBox} to an array with enormous dimensions, +% the default is \texttt{\string\grcxsp@maxDim = 5000}. This can be reset to +% larger value if you are embedding graphics of even more enormous dimensions. +% \begin{macrocode} +\def\grcxsp@maxDim{5000} +% \end{macrocode} +% Now, for the \cs{gxsp@embedEPS} command that embed the graphic +% between \textbf{BP} and \textbf{EP}. +% \begin{macrocode} +\newcommand{\gxsp@embedEPS}[2]{% + \gxsp@literalps@out{gsave \gxsp@setPSCoor + [ /BBox [-\grcxsp@maxDim\space-\grcxsp@maxDim\space + \grcxsp@maxDim\space\grcxsp@maxDim]\space/_objdef {Embedded:#2} + /BP pdfmark grestore}% + \message{<Embedding #1>}% +% \end{macrocode} +% If we are using dvipsone, we can suppress the preview of the embedded +% file by not using the extension. Dviwindo will look for a tiff file, if +% not present, will not display a preview. +% \begin{macrocode} + \includegraphics{#1}% + \gxsp@literalps@out{[ /EP pdfmark}% +} +% \end{macrocode} +% \end{macro} +% We create a wrapper that shows the Embedded file under the original +% symbolic name Here we introduce any transparency ordered up in the +% option list of \cs{embedEPS} +% \begin{macrocode} +\def\gcxsp@wrapEmbeddedFigure#1#2#3{% + \def\Gin@transparencygroup{#1}\def\Gin@transparency{#3}% + \gxsp@literalps@out{gsave \gxsp@setPSCoor + \ifGin@clip + [/BBox [\llxOf{#2}\space\llyOf{#2}\space + \urxOf{#2}\space\uryOf{#2}] + \else + [ /BBox [-\grcxsp@maxDim\space-\grcxsp@maxDim\space + \grcxsp@maxDim\space\grcxsp@maxDim] + \fi\space /_objdef {#2} + \ifx\Gin@transparencygroup\@empty\else + \ifx\Gin@transparencygroup\Gin@exclamation + /Group << /S/Transparency >>% + \else + /Group << /S/Transparency \Gin@transparencygroup >>% + \fi + \fi\space + /BP pdfmark + [ {Embedded:#2} /SP pdfmark + [/EP pdfmark + grestore}% +} +% \end{macrocode} +% \begin{environment}{createImage} +% The \texttt{createImage} environment can be used for two purposes: +%\begin{enumerate} +% \item Use it to take a file already embedded, manipulate it, and give it a symbolic name. +% \item Use postscript graphic operators to create an image. +%\end{enumerate} +% The images can be shown using \cs{includegraphics} or +% \cs{insertEPS}, or they can be referenced as an appearance of a +% form field. +% +% We try something different. My usual approach for a verbatim environment is to write +% the contents to an auxiliary file and input that file back in. This approach precludes +% using the environment in another command. The text to this environment should be PostScript +% or PDF language statements, or {\TeX} macros that expand to same. We'll absorb the +% contents in the environment as an argument \texttt{\#1} of the \cs{grxcsp@createImage} command. +% However, before we get to \cs{grxcsp@createImage} we must execute \cs{createImage}, the user's +% access to this code. +% +% \cs{createImage} takes three arguments, the first one of which is optional +%\begin{enumerate} +% \item[]\makebox[0pt][r]{\texttt{[\#1]}: }Takes the key-values of \cs{includegraphics}, plus some of +% the graphicxsp key-values, such as \texttt{transparencyGroup}. The name key +% is ignored, and is declared in the third parameter. +% \item[]\makebox[0pt][r]{\texttt{\#2}: }The bounding box for this image. +% \item[]\makebox[0pt][r]{\texttt{\#3}: }The \texttt{name} to be attached to this image. +%\end{enumerate} +%\changes{v.6}{2008/06/15 } +%{ +% Made \texttt{createImage} into a private environment, \texttt{sp@createImage}, which can be used anywhere, then +% created a public version, \texttt{createImage}, which is restricted to the preamble. This change +% is needed to create dynamic appearances in the \textsf{rmannot} package. +%} +% \begin{macrocode} +\newcommand{\sp@createImage}[3][]{% + \@ifundefined{#3Gin@llx}{}{% + \PackageError{graphicxsp}% + {The name, #3, on line \the\inputlineno\space\MessageBreak + is already defined. All embedded graphics\MessageBreak + must be assigned a unique name} + {Give this embedded graphic a unique name.}% + }% + \setkeys{Gin}{#1}\def\Gin@name{#3}% + \edef\@gtempa{#2 }% + \expandafter\Gread@parse@bb\@gtempa \\% + \begingroup\grxcsp@createImage +} +\let\postEP\@empty +\long\def\grxcsp@createImage#1\end#2{% + \def\reserved@a{#2}\ifx\reserved@a\@currenvir + \end{#2}\else\@badend{#2}\fi + \edef\temp@transparencyGroup{% + \ifx\Gin@transparencygroup\@empty\else + \ifx\Gin@transparencygroup\Gin@exclamation + /Group << /S/Transparency >>% + \else + /Group << /S/Transparency \Gin@transparencygroup >>% + \fi + \fi}% + \grcxsp@setPictureDimen% + {\Gin@name}{\Gin@llx}{\Gin@lly}{\Gin@urx}{\Gin@ury}% +% \end{macrocode} +% (2009/02/19) We use \cs{AddToEmbeddedEPSs} to embed EPS created by the +% \texttt{create\-Image} environment. This allows the EPS to be used on +% the first page, which has been a problem in the past. +% \begin{macrocode} + \edef\@tempa{% + \noexpand\AddToEmbeddedEPSs{\noexpand\AtPageLowerLeft{% + \noexpand\gxsp@literalps@out{gsave \gxsp@setPSCoor + [ /BBox [\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury] + /_objdef {\Gin@name} \temp@transparencyGroup\space/BP pdfmark + \ifx\Gin@transparency\@empty\else + [ \Gin@transparency\space/SetTransparency pdfmark\fi + {#1} ?pdfmark + [ /EP pdfmark + grestore + }% + }}}\@tempa + \endgroup +} +\let\createImage\sp@createImage +\let\endcreateImage\endsp@createImage +\@onlypreamble{\createImage} +% \end{macrocode} +% \end{environment} +% \begin{macro}{\insertEPS} +% The idea was to use the \cs{includegraphics} command to show a graphic that +% has been earlier embedded. However, one of \cs{includegraphics} arguments is +% the path of the eps file. Once, the file is embedded, the path is not needed, +% so this package defines \cs{insertEPS}. This command takes two arguments: (1) +% The usual \cs{includegraphics} options, plus any other options defined in this +% package; (2) the symbolic name. Because the symbolic name is passed as the second +% argument, it is not necessary to specify in the optional parameter list. The following +% two (should) be equivalent: +%\begin{verbatim} +% \embedEPS{myCoolSelfPic} +% ... +% \begin{document} +% ... +% \includegraphics[name=AdobeDon,width=1in]{myCoolSelfPic} +% \insertEPS[width=1in]{AdobeDon} +% ... +%\end{verbatim} +% \begin{macrocode} +\def\xsp@sanitize{\catcode`\_=12\relax} +\newcommand{\insertEPS}{\bgroup\xsp@sanitize + \@ifstar + {\Gin@cliptrue\let\gcxsp@star*\gcxsp@insertEPS}% + {\Gin@clipfalse\let\gcxsp@star\@empty\gcxsp@insertEPS}} +\newcommand{\gcxsp@insertEPS}[2][]% + {\expandafter\includegraphics\gcxsp@star[name=#2,#1]{}\egroup} +% \end{macrocode} +% \end{macro} +%\section{Messing with \textsf{graphicx}} +% In this section, we add some options to the \textsf{graphicx} package. We define +% some additional keys that will be recognized by \cs{includegraphics}. We also +% redefine \cs{Gin@ii} and \cs{Gin@setfile}, which are \textsf{graphicx} commands +% to make things work for us. +% \begin{macro}{name} +% Use the \texttt{name} key-value pair only for graphics already embedded by \cs{embedEPS}. +% When this key is present, we \cs{let} \cs{Ginclude@eps} to \cs{Ginclude@eps@SP}. +% \cs{Ginclude@eps} is the usual way of handling EPS files, \cs{Ginclude@eps@SP} +% is how we are to handle files already embedded. Usage: +%\begin{verbatim} +% \includegraphics[name=AdobeDon,width=1in]{myCoolSelfPic} +%\end{verbatim} +% \begin{macrocode} +\newif\if@Ginnamed\@Ginnamedfalse +\define@key{Gin}{name}[]{\def\Gin@name{#1}% + \@Ginnamedtrue\let\Ginclude@eps\Ginclude@eps@SP} +\def\Gin@name{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{transparencyGroup} +% This defines the transparencyGroup key which is used only +% recognized with \cs{embedEPS}. See the Transparency section of the +% pdfmark Reference and the chapter on Transparency in the PDF +% Reference. In particular, see PDF Ref Table 7.13. Usage: +%\begin{verbatim} +% \embedEPS[transparencyGroup]{myCoolSelfPic} +%\end{verbatim} +% \begin{macrocode} +\define@key{Gin}{transparencyGroup}[!]{\def\Gin@transparencygroup{#1}} +\def\Gin@transparencygroup{} +% \end{macrocode} +% \end{macro} +% \begin{macro}{transparency} +% Enter any transparency postscript key-value pairs for this image. +% These are ignored unless the embedded file is a transparency group, +% and you distill with \verb!<< /AllowTransparency true >>! +% setdistillerparams!. Usage: +%\begin{verbatim} +% \embedEPS[transparencyGroup]{myCoolSelfPic} +% ... +% \begin{document} +% ... +% \includegraphics[name=AdobeDon,width=1in, +% transparency={/ca .5 /BM/Normal}]{myCoolSelfPic} +%\end{verbatim} +%or +%\begin{verbatim} +% \insertEPS[width=1in,transparency={/ca .5 /BM/Normal}]{AdobeDon} +%\end{verbatim} +% \begin{macrocode} +\define@key{Gin}{transparency}[]{\def\Gin@transparency{#1}}% +\def\Gin@transparency{}% +\define@key{Gin}{SMask}[]{\def\Gin@SMask{#1}}% +\def\Gin@SMask{}% +% \end{macrocode} +% \end{macro} +% \begin{macro}{presp} +% \begin{macro}{postsp} +% We define two additional keys for creating special effects. The +% value of \texttt{presp} and \texttt{postsp} are postscript commands +% for manipulating the image. As the names suggest, \texttt{presp} is +% placed before the \textbf{SP} operator, and \texttt{postsp} is +% placed after. Example of usage is given in one of the demo files. +% \begin{macrocode} +\define@key{Gin}{presp}{\def\Gin@presp{#1}} +\def\Gin@presp{} +\define@key{Gin}{postsp}{\def\Gin@postsp{#1}} +\def\Gin@postsp{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% The following key-value pairs are recognized by \cs{setSMask}, +% \cs{embedEPS} and \cs{includegraphics} and are used to +% set up a soft mask. +% \begin{macro}{SMask} +% \begin{macro}{subtype} +% \begin{macro}{group} +% \begin{macro}{bc} +% \begin{macro}{tc} +% The key \texttt{SMask} is used in the optional parameter list of +% \cs{insertEPS} and \cs{includegraphics}, when that graphic is to +% use a soft mask. The value of \texttt{SMask} is a key-value list, +% the keys are \texttt{subtype}, \texttt{group}, \texttt{bc} and +% \texttt{tr}. The default for \texttt{subtype} is \texttt{Luminosity}, the other +% value recognized is \texttt{Alpha}. If \texttt{subtype} is not listed, \texttt{Luminosity} +% is used for the \texttt{subtype}. The \texttt{group} key is required, and the latex compile +% will stop if it is not specified. The value of group is the name of a graphic to be used +% as a mask. This graphic must be a transparency group with the \texttt{CS} key specified. +% The other two keys, \texttt{bc} (component color) and \texttt{tr} (transfer function) to +% complete the supported keys. See Table 7.10, page 553, of the \textsl{PDF Reference}, Version 8, +% for detailed descriptions of these key-values. +% \begin{macrocode} +\define@key{Gin}{SMask}[]{\def\GinSP@SMask{#1}} +\def\GinSP@SMask{} +\define@key{GinSP}{subtype}[Luminosity]{\def\GinSP@subtype{#1}} +\def\GinSP@subtype{Luminosity} +\define@key{GinSP}{group}[]{\def\GinSP@group{#1}} +\def\GinSP@group{} +\define@key{GinSP}{bc}[]{\def\GinSP@bc{#1}} +\def\GinSP@bc{} +\define@key{GinSP}{tr}[]{\def\GinSP@tr{#1}} +\define@key{GinSP}{None}[None]{\def\SMaskSP@None{#1}} +\def\GinSP@tr{} +\def\SMaskSP@None{} +\def\SMaskSP@Identity{Identity} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\setSMask} +% Use \cs{setSMask} to set a soft mask. This command takes one required argument, +% the name of the transparency group to be use as the source of alpha or color +% values for deriving the mask. The optional parameter consists of key-value +% pairs for the soft-mask dictionary, see table 7.10 of the PDF Reference, Version 8. +% \begin{macrocode} +\def\sp@setSMask{% + \ifx\GinSP@SMask\SMaskSP@None[ /SMask/None /SetTransparency pdfmark + \else + [ /SMask << /S/\GinSP@subtype\space + \ifx\GinSP@bc\@empty\else/BC\GinSP@bc\space\fi + \ifx\GinSP@tr\@empty\else\ifx\GinSP@tr\SMaskSP@Identity% + /TR/Identity\else/TR {\GinSP@tr}\space\fi\fi + /G {\GinSP@group} >> /SetTransparency pdfmark + \fi +} +\newcommand{\setSMask}[2][]{% + \setkeys{GinSP}{#1}\def\GinSP@group{#2}% + \special{ps: \sp@setSMask}% +} +% \end{macrocode} +% \end{macro} +% We redefine \cs{Gin@setfile}. If the graphic is named, we salt things +% with the bounding box parameters. +% \begin{macrocode} +\def\Gin@setfile#1#2#3{% + \ifx\\#2\\\Gread@false\fi + \ifGin@bbox\else + \ifGread@ +\if@Ginnamed %dps (08/16/07) + \edef\Gin@llx{\csname\Gin@name Gin@llx\endcsname}% + \edef\Gin@lly{\csname\Gin@name Gin@lly\endcsname}% + \edef\Gin@urx{\csname\Gin@name Gin@urx\endcsname}% + \edef\Gin@ury{\csname\Gin@name Gin@ury\endcsname}% +\else + \csname Gread@% + \expandafter\ifx\csname Gread@#1\endcsname\relax + eps% + \else + #1% + \fi + \endcsname{\Gin@base#2}% +\fi + \else + \Gin@nosize{#3}% + \fi + \fi + \Gin@viewport@code + \Gin@nat@height\Gin@ury bp% + \advance\Gin@nat@height-\Gin@lly bp% + \Gin@nat@width\Gin@urx bp% + \advance\Gin@nat@width-\Gin@llx bp% + \Gin@req@sizes + \expandafter\ifx\csname Ginclude@#1\endcsname\relax + \Gin@drafttrue + \expandafter\ifx\csname Gread@#1\endcsname\relax + \@latex@error{Can not include graphics of type: #1}\@ehc + \global\expandafter\let\csname Gread@#1\endcsname\@empty + \fi + \fi + \leavevmode + \ifGin@draft + \hb@xt@\Gin@req@width{% + \vrule\hss + \vbox to \Gin@req@height{% + \hrule \@width \Gin@req@width + \vss + \if@Ginnamed %dps (08/18/07) +% \end{macrocode} +% If the \texttt{shownonames} option is taken, we do not show the name of the graphic. +% \begin{macrocode} + \if@spx@shownameindraft + \rlap{ \ttfamily\Gin@name}\fi + \else + \edef\@tempa{#3}% + \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}% + \fi + \vss + \hrule}% + \hss\vrule}% + \else +\if@Ginnamed\else % dps (08/16/07) + \@addtofilelist{#3}% + \ProvidesFile{#3}[Graphic file (type #1)]% +\fi + \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}% + \dp\z@\z@ + \ht\z@\Gin@req@height + \wd\z@\Gin@req@width + \ifpreview{\setlength{\fboxsep}{0pt}\fbox{\box\z@}}\else\box\z@\fi% + \fi} +\def\Gin@getbase#1{% + \edef\Gin@tempa{% + \def\noexpand\@tempa####1#1\space{% + \def\noexpand\Gin@base{####1}}}% +% \end{macrocode} +% If the current graphic is named, then we don't need to read the bounding +% box again or to see if it exists again. +% \begin{macrocode} + \if@Ginnamed + \edef\Gin@ext{#1}\edef\Gin@base{\Gin@name}%dps (08/18/07) + \else +% \end{macrocode} +% If not named, we need to handle it in the usual way. +% \begin{macrocode} + \IfFileExists{\filename@area\filename@base#1}% + {\Gin@tempa + \expandafter\@tempa\@filef@und + \edef\Gin@ext{#1}}{}% + \fi +}% +% \end{macrocode} +% \begin{macro}{\Gin@computeSF} +% Based on scaling info provided by graphicx, we compute the scale factors +% we need. +% \begin{macrocode} +\def\Gin@computeSF{% + \def\@tempa{!}% + \edef\gxsp@scaleFactor@x{\Gin@scalex}% + \edef\gxsp@scaleFactor@y{\Gin@scaley}% + \ifx\Gin@scaley\@tempa % proportional height + \ifx\Gin@scalex\@tempa % proportional width + \def\gxsp@scaleFactor@x{1}% + \def\gxsp@scaleFactor@y{1}% + \else % specified width + \edef\gxsp@scaleFactor@y{\Gin@scalex}% + \fi + \else % specified height + \ifx\Gin@scalex\@tempa % proportional width + \edef\gxsp@scaleFactor@x{\Gin@scaley}% + \fi + \fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\Ginclude@eps@SP} +% This is the substitute for the usual way of handing an EPS file. +% Here we use the \textbf{SP} to show the embedded graphic. +% \begin{macrocode} +\def\gxsp@setBBox{% + \ifGin@clip + [/BBox [\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury] + \else + [/BBox [-\grcxsp@maxDim\space-\grcxsp@maxDim\space + \grcxsp@maxDim\space\grcxsp@maxDim] + \fi +} +\def\Ginclude@eps@SP#1{% +% \message{<#1>}% + \bgroup +% \end{macrocode} +% See if the user has specified the \texttt{SMask} key, if yes, we'll +% check to see if a group name was specified. The group name is required. +% If no, we halt the compile job. +% \begin{macrocode} + \ifx\GinSP@SMask\@empty\else + \edef\sp@expand@temp{\noexpand\setkeys{GinSP}{\GinSP@SMask}}% + \sp@expand@temp + \ifx\SMaskSP@None\@empty\ifx\GinSP@group\@empty + \PackageError{graphicxsp}{The group key is required when you + specify a SMask.}{Specify a group name for the group key.}% + \fi\fi\fi + \Gin@computeSF + \ifGin@bbox + \gxsp@literalps@out{% + gsave \gxsp@setPSCoor +% \end{macrocode} +% If \texttt{SMask} is specified, we call \cs{sp@setSMask} to +% set the graphics state parameters for a soft mask. +% \begin{macrocode} + \ifx\GinSP@SMask\@empty\else\sp@setSMask\fi + \gxsp@setBBox\space +% \end{macrocode} +% We push the basename \verb!(\Gin@name:bbox)! and call \texttt{grcxspObjDef}. +% This procedure returns \verb!(\Gin@name:bboxgraphicxspCnt-currentpage)!. +% \texttt{graphicxspretn} then takes that result, and converts it to a name type. +% We then use it in \verb!/_objdef {//graphicxspretn}!, using immediate execution. +% \begin{macrocode} + (\Gin@name:bbox@) grcxspObjDef + /graphicxspretn exch cvx cvn def + /_objdef {//graphicxspretn} /BP pdfmark + \ifx\Gin@transparency\@empty\else + [ \Gin@transparency\space/SetTransparency pdfmark\fi + [ {\Gin@name} /SP pdfmark + [ /EP pdfmark + \gxsp@scaleFactor@x\space\gxsp@scaleFactor@y\space scale + -\Gin@llx\space -\Gin@lly\space moveto + currentpoint translate + \Gin@presp + [ {//graphicxspretn} /SP pdfmark + \Gin@postsp + grestore + }% + \else + \gxsp@literalps@out{% + gsave \gxsp@setPSCoor +% \end{macrocode} +% If \texttt{SMask} is specified, we call \cs{sp@setSMask} to +% set the graphics state parameters for a soft mask. +% \begin{macrocode} + \ifx\GinSP@SMask\@empty\else\sp@setSMask\fi + \gxsp@setBBox\space + (\Gin@name:grxsp@) grcxspObjDef + /graphicxspretn exch cvx cvn def + /_objdef {//graphicxspretn} /BP pdfmark + \ifx\Gin@transparency\@empty\else + [ \Gin@transparency\space/SetTransparency pdfmark\fi + [ {\Gin@name} /SP pdfmark + [ /EP pdfmark + \gxsp@scaleFactor@x\space\gxsp@scaleFactor@y\space scale + \ifx\Gin@viewport@code\relax\else + -\Gin@llx\space-\Gin@lly\space moveto + currentpoint translate\fi + \Gin@presp + [ {//graphicxspretn} /SP pdfmark + \Gin@postsp + grestore + }% + \fi + \egroup} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +%</package> +% \end{macrocode} +% \Finale +\endinput diff --git a/texmf-dist/source/latex/graphicxsp/graphicxsp.ins b/texmf-dist/source/latex/graphicxsp/graphicxsp.ins new file mode 100644 index 00000000..e499aa23 --- /dev/null +++ b/texmf-dist/source/latex/graphicxsp/graphicxsp.ins @@ -0,0 +1,60 @@ +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% Copyright 1999-2006 D. P. Story +%% +%% This file is part of the `AcroTeX eDucation Bundle'. +%% ------------------------------------------- +%% +%% It may be distributed under the conditions of the LaTeX Project Public +%% License, either version 1.2 of this license or (at your option) any +%% later version. The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\filedate{2007/08/14} +\def\batchfile{graphicxsp.ins} + +\input docstrip +\ifx\generate\undefined + \Msg{**********************************************} + \Msg{*} + \Msg{* This installation requires docstrip} + \Msg{* version 2.4 or later.} + \Msg{*} + \Msg{* An older version of docstrip has been input} + \Msg{*} + \Msg{**********************************************} + \errhelp{Move or rename old docstrip.tex and get a newer one.} + \errmessage{Old docstrip in input path} + \batchmode + \csname @@end\endcsname\end +\fi + +\keepsilent +\askforoverwritefalse +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\preamble +\endpreamble + +\generate +{% + \file{graphicxsp.sty}{\from{graphicxsp.dtx}{copyright,package}} +} + +\Msg{***************************************************************} +\Msg{*} +\Msg{* \space To finish the installation you have to copy the files } +\Msg{*} +\Msg{* \space *.sty, *.cfg and *.def into a directory searched by TeX} +\Msg{*} +\Msg{***************************************************************} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput |