From cfe306ba1b7ec40855a300580b7981845d56edeb Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 13 Jul 2017 10:25:48 +0900 Subject: add aeb-mlink aeb-pro aebxmp graphicxsp annot-pro --- texmf-dist/source/latex/aeb-pro/aeb.js | 24 + texmf-dist/source/latex/aeb-pro/aeb_pro.dtx | 4903 ++++++++++++++++++++ texmf-dist/source/latex/aeb-pro/aeb_pro.ins | 67 + texmf-dist/source/latex/aeb-pro/aeb_pro.js | 130 + texmf-dist/source/latex/aeb-pro/doc/aebpro_man.tex | 3793 +++++++++++++++ .../source/latex/aeb-pro/extras/AeB_Logo.eps | Bin 0 -> 289706 bytes .../source/latex/aeb-pro/extras/AeB_Logo.pdf | Bin 0 -> 34683 bytes .../source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf | Bin 0 -> 25733 bytes .../source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf | Bin 0 -> 30674 bytes .../latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf | Bin 0 -> 44428 bytes .../latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf | Bin 0 -> 27099 bytes texmf-dist/source/latex/aeb-pro/extras/aest.xls | Bin 0 -> 677888 bytes texmf-dist/source/latex/aeb-pro/extras/ease.pdf | Bin 0 -> 109690 bytes texmf-dist/source/latex/aeb-pro/extras/trek.wav | Bin 0 -> 89864 bytes texmf-dist/source/latex/aeb-pro/fsprodef.js | 64 + .../latex/aeb-pro/icons/btn_anime_icons1.pdf | Bin 0 -> 15812 bytes 16 files changed, 8981 insertions(+) create mode 100644 texmf-dist/source/latex/aeb-pro/aeb.js create mode 100644 texmf-dist/source/latex/aeb-pro/aeb_pro.dtx create mode 100644 texmf-dist/source/latex/aeb-pro/aeb_pro.ins create mode 100644 texmf-dist/source/latex/aeb-pro/aeb_pro.js create mode 100644 texmf-dist/source/latex/aeb-pro/doc/aebpro_man.tex create mode 100644 texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.eps create mode 100644 texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/aest.xls create mode 100644 texmf-dist/source/latex/aeb-pro/extras/ease.pdf create mode 100644 texmf-dist/source/latex/aeb-pro/extras/trek.wav create mode 100644 texmf-dist/source/latex/aeb-pro/fsprodef.js create mode 100644 texmf-dist/source/latex/aeb-pro/icons/btn_anime_icons1.pdf (limited to 'texmf-dist/source/latex/aeb-pro') 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. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\NeedsTeXFormat{LaTeX2e}[1997/12/01] +%\ProvidesPackage{aeb_pro} +% [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} +% +% \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=} % 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 +% +%<*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 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)] +% {}\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 +% +%<*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 <> +% Fit Page <> +% Fit Width <> +% Fit Height <> +% Fit Visible <> +%\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<>\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<>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<>\else + /OpenAction<>\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<>\else + /OpenAction<>\fi + \fi +\else\ifxetex + \ifx\aeb@layoutMagPage\@empty + \ifx\aeb@layoutMagMag\@empty + /OpenAction \pubAddToDocOpen + \else/OpenAction<>\fi + \else + \ifx\aeb@layoutMagMag\@empty + /OpenAction<>\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 +% +%<*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 +% +%<*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}|. Also defined +% a convenience command \cs{getcNameFromFileName} for that purpose; for example, +% |\getcNameFromFileName{}|. +% \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<>}% + \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 +% +%<*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 +% +%<*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[]{ +% \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|$ ~ % ''} +\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}}{} 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 new file mode 100644 index 00000000..36322513 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.eps differ diff --git a/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf new file mode 100644 index 00000000..c41d81c4 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo.pdf differ 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 new file mode 100644 index 00000000..e27e574d Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw15.pdf differ 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 new file mode 100644 index 00000000..63ccd7e4 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/AeB_Logo_bw50.pdf differ 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 new file mode 100644 index 00000000..a059d308 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_DesignV_AeB.pdf differ 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 new file mode 100644 index 00000000..44f415a8 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/Manual_BG_Print_AeB.pdf differ diff --git a/texmf-dist/source/latex/aeb-pro/extras/aest.xls b/texmf-dist/source/latex/aeb-pro/extras/aest.xls new file mode 100644 index 00000000..55e0bcd5 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/aest.xls differ diff --git a/texmf-dist/source/latex/aeb-pro/extras/ease.pdf b/texmf-dist/source/latex/aeb-pro/extras/ease.pdf new file mode 100644 index 00000000..20c8a637 Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/ease.pdf differ diff --git a/texmf-dist/source/latex/aeb-pro/extras/trek.wav b/texmf-dist/source/latex/aeb-pro/extras/trek.wav new file mode 100644 index 00000000..b8d9e65d Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/extras/trek.wav differ 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 new file mode 100644 index 00000000..7bb4e30c Binary files /dev/null and b/texmf-dist/source/latex/aeb-pro/icons/btn_anime_icons1.pdf differ -- cgit v1.2.3