% Acrobat required
% use useacrobat option with pdftex and xetex if you have acrobat
\documentclass{article}
\usepackage[%
    gopro,
    web={designiv,usesf,tight},
    attachsource={tex},
    attachments={%
        children/theeuro.pdf,       % AeB Attachment 1
        children/explog.pdf,        % AeB Attachment 2
        ../extras/aest.xls,         % AeB Attachment 3
        ../extras/ease.pdf          % AeB Attachment 4
    },
    linktoattachments,
    eforms
]{aeb_pro}

\DeclareDocInfo
{
    title=The AeB Pro Package\texorpdfstring{\\[1ex]}{:} Creating a Package of Files,
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject=Test file for the AeB Pro package,
    keywords={Adobe Acrobat, JavaScript},
    talksite=http://www.acrotex.net,
    talkdate={January 12, 2007},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Version}
\version{1.0}\nocopyright

\newcommand{\cs}[1]{\texttt{\char`\\#1}}
\newcommand\newtopic{\par\ifdim\lastskip>0pt\relax\vskip-\lastskip\fi
\par\vskip6pt\noindent}
\def\aftersverbskip{\noindent}
\newenvironment{sverbatim}
{\par\small\verbatim}
{\endverbatim\par\aftergroup\aftersverbskip}
\def\AcroTeX{Acro\negthinspace\TeX}

\begin{attachmentNames}
\autolabelNum*{1}{European Currency \u\EURO}
\autolabelNum*{2}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
%\autolabelNum*{2}{\u\DQUOTE$|e^\u\LBRACE\u005Cln(17)\u\RBRACE|$\u\DQUOTE}
\autolabelNum*[AeST]{3}{The AeBST Components}
\autolabelNum*[atease]{4}{The @EASE Control Panel}
\end{attachmentNames}

\makePDFPackage{viewmode=tile} % tile, details, hidden
% Try compiling with this option
%\makePDFPackage{viewmode=tile,initview=attach1}

% choose view > Portfolio > Cover Sheet to recover the cover sheet

\optionalPageMatter
{%
    \par\bigskip
    \begin{minipage}{.67\linewidth}
    Link testing:
    \begin{itemize}
        \item See the \ahyperlink{attach1}{Euro}
        \item See my \ahyperlink{attach2}{formerly favorite number}
        \item See the \ahyperlink{atease}{@EASE Control Panel}
        \item View the \ahyperextract[launch=view]{AeST}{AeST Components}
    \end{itemize}
    \end{minipage}
}

\begin{document}

\maketitle

\section*{The \protect\cs{makePDFPackage} command}

The concept of a PDF Package is introduced in Acrobat~8.\footnote{The PDF Package
has had several name changes, originally known as a Collection, a Portable Collection,
a PDF Package, and finally a (PDF) Portfolio.} 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 AeB Pro.
What AeB Pro provides is packaging of the embedded files with the
nice UI.

\newtopic The procedure is as follows: Embed all files files in the
parent as described in \texttt{aebpro\_ex5.pdf}, and use the command
\cs{makePDFPackage} to package the attachments. The syntax is
\begin{verbatim}
    \makePDFPackage{<key-values>}
\end{verbatim}
There are only two sets of key-value pairs
\begin{description}
    \item[\texttt{initview=<label>}:] Specifying a value for the
        initview key determines which file will be used as the initial
        view when the document is opened. If
        \texttt{initview=attach2}, for this document, then the file
        corresponding to the label \texttt{attach2}, as set up in the
        \texttt{attachmentNames} environment is the initial view.
        Listing \texttt{initview} with no value (or if
        \texttt{initview} is not listed at all) causes the parent
        document -- also called the \emph{cover sheet} -- to be
        initially shown.

    \item[\texttt{viewmode=details|tile|hidden}:] The
        \texttt{viewmode} determines which of the three user
        interfaces is to be used initially. In terms of the UI
        terminology: $\texttt{details} = \textsf{View top}$;
        $\texttt{tile} = \textsf{View left}$; and $\texttt{hidden} =
        \textsf{Minimize view}$. The default is \texttt{details}.
\end{description}
If you use this command with an empty argument list,
\verb!\makePDFPackage{}!, you create a PDF package with the
defaults.

When navigating a PDF Package (Portfolio) the cover sheet can be viewed by
accessed through the menu item \texttt{View > Portfolio > Cover Sheet}.

\newtopic\textbf{\textcolor{red}{TIP:}} Use the \cs{autolabelNum*}
command to assign a more informative description of the attachments,
like so.
\begin{sverbatim}
    \autolabelNum*{1}{European Currency \u20AC}
    \autolabelNum*{2}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
    \autolabelNum*[AeST]{3}{The AeBST Components}
    \autolabelNum*[atease]{4}{The @EASE Control Panel}
\end{sverbatim}

Note that there is an alternative that is commented out to the assignment of the
second attachment, it is
\begin{sverbatim}
    \autolabelNum*
        {2}{\u\DQUOTE$|e^\u\LBRACE\u005Cln(17)\u\RBRACE|$\u\DQUOTE}
\end{sverbatim}
One can use the ``helper'' commands, as described in \texttt{aeb\_pro.tex}; however,
there is a slight problem.  Within the \texttt{<description>} argument, we obey spaces, so
if we were to say \verb!\u\LBRACE\u\BSLASH ln(17)\u\RBRACE! there would be a space
after the backslash. This is the reason we used \cs{u005C}.

\newtopic That's it!  Hope you enjoy this feature and find a good
use for it.

\end{document}
