%
% http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf
%
% makeindex < aebpro_man.idx > aebpro_man.ind
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage[%
    web={centertitlepage,designv,
        forcolorpaper,latextoc,pro},%usesf,
        aebxmp,eforms
]{aeb_pro}
\usepackage[dvipsone,showembeds]{graphicxsp}
\usepackage{aeb_mlink}
\usepackage{array,longtable}
%\usepackage{myriadpro}
\usepackage[altbullet]{lucidbry}
\usepackage[use3D]{rmannot}

\usepackage{makeidx}
\makeindex
\usepackage{acroman}

\usepackage[active]{srcltx}

\setlongtables

\def\expath{../examples/rma}

\urlstyle{rm}

%\def\tutpath{doc/tutorial}
%\def\tutpathi{tutorial}

\DeclareDocInfo
{
    university={\AcroTeX.Net},
    title={ The \texorpdfstring{\texttt{rmannot} Package\\[1em]}{rmannot Package: }
        Rich Media Annotations\texorpdfstring{\\[1em]}{ }for Acrobat 9 Pro, or later},
    author={D. P. Story},
    email={dpstory@acrotex.net},
    subject={Documentation for AeB Pro from AcroTeX},
    talksite={\url{www.acrotex.net}},
    version={2.0},
    keywords={Rich Media Annotations, SWF, FLV, MP3, AcroTeX, AcroFlex, LaTeX},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL={http://www.acrotex.net}
}
\nocopyright
\copyrightyears{2008-\the\year}
\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}}

\definePath{\urlAcroTeXBlog}{http://www.acrotex.net/blog}

%\pagestyle{empty}
\parindent0pt\parskip\medskipamount

\newcommand{\myRMFiles}{%
    C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{AcroAd}{\myRMFiles/Acro_Advertiser.swf}
\saveNamedPath{horse1}{\myRMFiles/horse1.flv}
\saveNamedPath{trek}{\myRMFiles/trek.mp3}
\saveNamedPath{AcroLimerick}{\myRMFiles/AcroTeX_limerick.mp3}
\makePoster[hiresbb]{AcroAd_poster}{\expath/AcroAd_poster}
\makePoster[hiresbb]{aebmovie_poster}{\expath/aebmovie_poster}
\makePoster[hiresbb]{horse1_poster}{\expath/horse1_poster}

\definePath{\myPath}{C:/Users/Public/Documents/%
    My TeX Files/tex/latex/aeb/aebpro/rmannot/%
    examples/rm3da}
\definePath{\myRMFiles}{%
    C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{myDice}{\myPath/3dmodels/dice.u3d}

\optionalPageMatter
{%
    \makebox[\linewidth][c]{%
        \rmAnnot[poster=AcroAd_poster,enabled=pageopen]%
            {.5\linewidth}{.5\linewidth*\ratio{265bp}{612bp}}{AcroAd}}%
}

\definePath{\bgPath}{"C:/Users/Public/Documents/ManualBGs/Manual_BG_Print_AeB.pdf"}
\begin{docassembly}
\addWatermarkFromFile({
    bOnTop:false,
    cDIPath:\bgPath
});
\executeSave();
\end{docassembly}

\def\puncPt#1{#1}

\begin{document}

\maketitle

\selectColors{linkColor=black}
\tableofcontents
\selectColors{linkColor=webgreen}

\section{Introduction}

Beginning with version 9, \textbf{Adobe Reader} and \textbf{Acrobat}
contain an embedded \textbf{Adobe Flash Player} that will play \textsf{SWF},
\textsf{FLV}, and \textsf{MP3} files. A new annotation type, called a \emph{rich media
annotation}, was developed to manage these media file types in a PDF
file.

The \texttt{rmannot} package supports the creation of rich media
annotations (a \texttt{RichMedia} annotation type), and the
embedding of \textsf{SWF}, \textsf{FLV}, and \textsf{MP3} files in a PDF. \textsf{SWF} animations, \textsf{FLV}
video, and \textsf{MP3} sound can then be played within a PDF viewed within
version 9 (or later) of \textbf{Adobe Reader} or \textbf{Acrobat}.\footnote{The
\texttt{rmannot} package was written, in part, to support the
{\AcroFLeX} Graphing package.}

Source material for the creation of this package is the document
\textsl{Adobe Supplement to the ISO 32000}, June 2008. This document
contains the PDF specification---the so called, BaseLevel~1.7,
ExtensionLevel~3 specification---of the rich media annotation.

\exAeBBlogPDF{p=}\textbf{Examples.} In addition to the examples that ship with the
\textsf{rmannot} package, there are numerous examples of \textsf{rmannot}
on my \href{\urlAcroTeXBlog//?tag=rmannot-package}{{\AcroTeX} Blog}. I
wrote a whole series of articles on the \textbf{\href{\urlAcroTeXBlog/?cat=22}{Rich Media
Annotation}} using \textbf{AeB Pro} and \textsf{rmannot}.

\textbf{Version 2.0 or later.} With this version, we introduce 3D models.
Version 9.0 of Acrobat introduced the rich media annotation, buried in the
specifications for RMA are references to 3D models. This structure was
designed for having 3D model and rich media (SWF, FLV) in the same
annotation. We now support what I am calling the \textbf{RM3D} annotations
What is created is not a 3D annotation, but a rich media annotation with
3D content. See \hyperref[RM3D]{Section~\ref*{RM3D}}, page~\pageref*{RM3D}
for details. A simple example appears on page~\pageref*{RM3Dexample}.

\section{Requirements}

The requirements for your {\LaTeX} system, and well as any other
software, is highlighted in this section.

\subsection{{\LaTeX} Package Requirements}

The following packages, in addition to the standard {\LaTeX}
distribution, are required:
\begin{enumerate}
  \item The \texttt{xkeyval} package is used to set up the key-value
      pairs of the \cs{rmAnnot} command. Get a recent version.
  \item AeB (\AcroTeX{} eDucation Bundle) The most recent version.
      In particular the \texttt{eforms} package and its companion
      package \texttt{insdljs}. The AeB Pro package is recommended. (All
      the demo files use AeB Pro.)
  \item The \texttt{graphicxsp} Package. The latest version, I made
      some slight modifications of this package for \texttt{rmannot}.
      This package allows the embedding of poster graphics for use in
      the appearances of the annotations when they are not activated.
\end{enumerate}
If you don't have AeB or \texttt{graphicxsp}, you can obtain the
latest versions from The AeB Home page\footnote{AeB:
\url{http://www.math.uakron.edu/~dpstory/webeq.html}} and the
GraphicxSP home page.\footnote{GraphicxSP:
\url{http://www.math.uakron.edu/~dpstory/graphicxsp.html}} The
installation instructions for AeB must be read very closely as there
are certain JavaScript files that must be copied to the correct location
on your local hard drive. The AeB Pro package can be obtained from
its home page as well.\footnote{AeB Pro:
\url{http://www.math.uakron.edu/~dpstory/aeb_pro.html}} It too has a
JavaScript file that needs to be installed, placement is important.


\subsection{PDF Creator Requirements}

The \textsf{rmannot} package supports \textbf{Acrobat Distiller 9.0} (or
later) as the PDF creator. The document author must have
\textbf{Acrobat 9.0 Pro} and its companion application
\textbf{Distiller}. The document author typically uses dvips to
produce a PostScript file, which is then distilled to obtain a PDF.

\subsection{Supported Media Formats}

\subsubsection{Supported Video Formats}

The resource for video formats is
\href{http://kb2.adobe.com/cps/405/kb405848.html}{Supported file formats |
Acrobat, Reader}, see the sections \textbf{Video formats (Acrobat X Pro)}
and \textbf{Video formats (Acrobat~9 Pro and Pro Extended)}.  The
\textsf{rmannot} package generally supports all formats listed there that
have a `Yes' in the column labeled \textbf{Direct placement without
transcoding}; in particular, \textsf{rmannot} supports \textbf{SWF},
\textbf{FLV}, \textbf{F4V}, \textbf{MP4}, \textbf{M4V}, \textbf{MOV},
\textbf{3GP}, \textbf{3G2}, and \textbf{MP3} files. Some of these are not
supported by version~9. For greatest compatibility, use \textbf{SWF},
\textbf{FLV} (or \textbf{F4V}, Version~9.2 or later).


\subsubsection{Supported Audio Format}

The resource for audio formats is
\href{http://kb2.adobe.com/cps/405/kb405848.html}{Supported file formats |
Acrobat, Reader}, see the section \textbf{Audio formats (Acrobat)}. For
assured compatibility, use \textbf{MP3} files for audio.



\section{Installation}

The installation is simple enough. Unzip \texttt{rmannot.zip} in a
folder that is on your {\LaTeX} search path.  Refresh your filename
database, if appropriate.

I am perhaps the last one using YandY, but if there is anyone else,
there is one other thing to do. The distribution comes with the
default poster file for the \textsf{MP3} file; the name of this file is
\texttt{ramp3poster.eps} (found in the \texttt{graphics} subfolder).
For YandY users, this file needs to be copied to a folder on the
\texttt{PSPATH}. If you don't know what I'm talking about, follow
the steps below.

Open \textsf{dviwindo}, and go to \texttt{Preferences > Environment}
and choose \texttt{PSPATH} from the drop down menu. Add the path
\begin{Verbatim}[fontsize=\small]
    C:\yandy\tex\latex\contrib\rmannot\graphics\\
\end{Verbatim}
at the end of your \texttt{PSPATH} string.\footnote{If your
\textsf{YandY System} installation is elsewhere, enter that path.}
It is important to have the double backslash at the end of the path.
This tells the \textsf{YandY System} to search all subfolders for
the graphics files. When you are finished, your \texttt{PSPATH}
should look something like this:
\begin{Verbatim}[fontsize=\small]
    C:\yandy\ps;C:\yandy\tex\latex\contrib\rmannot\graphics\\
\end{Verbatim}
Be sure to separate these paths by a semicolon.

\textbf{\textcolor{red}{Important:}} In recent versions of Acrobat,
security restrictions have been put in place to prevent
\textbf{Distiller} from reading files (the PostScript \textbf{file}
operator does not work). Fortunately, Distiller has a switch that
turns off this particular restriction. To successfully use this
package, therefore, you need to run Distiller by using the
\texttt{-F} command line switch. I personally use the WinEdt
application as my text editor,\footnote{WinEdt home page:
\url{www.winedt.com}} and have defined a Distiller button on my
toolbar. The Distiller button executes the following WinEdt macro.
\begin{Verbatim}[fontsize=\footnotesize]
Run(|"c:\Program Files\Adobe\Acrobat 9.0\Acrobat\acrodist.exe" -F "%P\%N.ps"|,
    '%P',0,0,'%N.ps - Distiller',1,1);
\end{Verbatim}
Note the use of the \texttt{-F} switch for \texttt{acrodist.exe}. If
this package is used to create rich media annotations without the
\texttt{-F} switch, you typically get the following error message in
the Distiller log file
\begin{Verbatim}[fontsize=\small]
%%[ Error: undefinedfilename; OffendingCommand: file ]%%
\end{Verbatim}
This tells you that either you have not started Distiller with the
\texttt{-F} command line switch, or Distiller can't find one of the
files that the \textbf{file} operator was trying to read.

\newtopic \textbf{Mac OS Users.} The above comments on the \texttt{-F} command line switch
is for Windows users, Mac OS user must choose the \texttt{AllowPSFileOps} user preference, this is located
in the \texttt{plist}, possibly located at
\begin{Verbatim}[fontsize=\small]
/Users/[User]/Library/Preferences/com.adobe.distiller9.plist
\end{Verbatim}
You can use Spotlight, the search utility on Mac, to search for \texttt{com.adobe.distiller}.
This finds the file \texttt{com.adobe.distiller9.plist}. Clicking on this find,
Spotlight opens \texttt{com.adobe.distiller9.plist} in the \texttt{plist} editor, see \hyperref[plist]{Figure~\ref*{plist}}.
If necessary, click on the arrow next to the Root to expand the
choices, then click the up and down arrows at the far
right in the \texttt{AllowPSFileOps} row to select Yes as the value.
\begin{figure}[hbt]\setlength{\fboxsep}{0pt}
\begin{center}
\fbox{\includegraphics[width=.75\linewidth]{plistEditor}}
\caption{com.adobe.distiller9.plist}\label{plist}
\end{center}
\end{figure}

% \section{Options of this Package}


\section{Setting the Paths and Posters}

The paths to \textsf{SWF}/\textsf{FLV}/\textsf{MP3} files are required to appear in the preamble, and any poster
graphics are required to appear in the preamble as well.

\subsection{Setting the Paths}

There are two types of paths: System paths to resources needed by
\textbf{Acrobat Distiller}, and media paths to the files used in the
document.

\paragraph*{System Paths.} This package uses \textbf{Acrobat Distiller~9.0}
(or later), and requires the document author to have \textbf{Acrobat 9 Pro}.
In the \textbf{Acrobat} program folder is a \texttt{Multimedia Skins} folder.
This folder contains skins (\textsf{SWF} files) used in providing playing
controls to \textsf{FLV} video files, and in the \texttt{Players} subfolder
you will find VideoPlayer.swf and AudioPlayer.swf. The former plays
\textsf{FLV} files with an appropriate skin for user controls, the latter
plays \textsf{MP3} files. The document author needs to set these paths to
these files, which are passed on to the distiller. For this purpose
use \Com{pathToSkins}. The default definition follows:
\begin{dCmd*}{\linewidth}
\pathToSkins{%
    C:/Program Files/Adobe/Acrobat 9.0/Acrobat/Multimedia Skins}
\end{dCmd*}
This is the path on my WinXP system. The path for the Mac OS may look like
\begin{dCmd*}{\linewidth}
\pathToSkins{/Applications/Adobe\ Acrobat\ 9\ Pro/Adobe\ Acrobat\
    Pro.app/Contents/MacOS/Multimedia\ Skins}
\end{dCmd*}
These paths may differ from platform to platform. Note what the path is to
the Multimedia Skins folder. The command \cs{pathToSkins} also
defines the path to the \texttt{Players} subfolder. Future releases
of \textbf{Acrobat} may change the name of the folders, so a
\Com{pathToPlayers} command is also provided; as with
\cs{pathToSkins}, \cs{pathToPlayers} takes one argument, the path to
the players.

\handpoint The \textsf{rmannot} distribution comes with a
\texttt{rmannot.cfg} file. In this file, you can set the path to the
multimedia skins (\cs{pathToSkins}) on your system. Read the
instructions contained in this file.

\paragraph*{Document Media Paths.}

Each media file (\textsf{SWF}, \textsf{FLV}, \textsf{MP3}) must be declared in the preamble
using the \Com{saveNamedPath} command.
\begin{dCmd}{.67\linewidth}
\saveNamedPath[<mime_type>]{<name>}{<path>}
\end{dCmd}
The first optional argument \texttt{<mime\_type>} is normally not
needed. It is the mime type of the file. Currently, only \textsf{SWF}, \textsf{FLV}
and \textsf{MP3} files are supported, and the extension of the file name is
isolated to determine the mime type.  The second parameter
\texttt{<name>} is a \emph{unique} name that will be used to
reference this media file. Finally, \texttt{<path>} is full and absolute path
to the media file. The path includes the file name and extension.

For example,
\begin{dCmd*}{.85\linewidth}
\saveNamedPath{mySWF}{C:/myMedia/AcroFlex3_demo.swf}
\saveNamedPath{fishing}{C:/myMedia/100_0239.flv}
\saveNamedPath{summertime}{C:/myMedia/Summertime.mp3}
\end{dCmd*}

Once the paths are defined in this way, the media files are
referenced using their given names. This has a couple of purposes.
\begin{enumerate}
    \item The names are used to determine if the media file has
        already been embedded in the document. Though the media clip
        may be used in several rich media annotations, the \texttt{rmannot}
        attempts to embed a media file only once.
    \item The command \cs{saveNamePath} uses
        \cs{hyper@normalise}, of the \texttt{hyperref} package, to
        ``sanitize'' special characters, so the path may contain
        characters that normally have special meaning to {\LaTeX}.
    \item Defining the path once leads to a consistent reference to
        the file paths, and reduces the chance of typos.
\end{enumerate}

A brief example to illustrate the use of the names assigned by the
\cs{saveNamedPath} follows:
\begin{dCmd*}{.75\linewidth}
\rmAnnot{200bp}{200bp}{mySWF}
\end{dCmd*}
See \Nameref{rmAnnot} for additional details on the \texttt{poster}
key and the \cs{rmAnnot} command.

The above example would use the default poster image to give a
visual of the annotation when it is not activated. The next section
discusses how to define and implement your own poster image.

\paragraph*{Defining a RM Path.}

The resources (\texttt{.flv}, \texttt{.swf}, \texttt{.mp3} files, for example)
for your Flash application my reside on your local computer or in the Internet.
As a way of reducing the amount of typing, you can use \Com{defineRMPath}
to define common paths to your resources.
\begin{dCmd}{.67\linewidth}
\defineRMPath{<name>}{<path>}
\end{dCmd}
The command uses \cs{hyper@normalise} (of \textsf{hyperref}) to ``sanitize'' the path.
The first argument \verb!<\name>! is the name of the command to be created, and
\verb!<path>! is the path. After the definition \verb!<\name>! expands to
\verb!<path>!. For example,
\begin{dCmd*}{.85\linewidth}
\defineRMPath{\myRMFiles}{C:/myMedia}
\saveNamedPath{mySWF}{\myRMFiles/AcroFlex3_demo.swf}
\saveNamedPath{fishing}{\myRMFiles/100_0239.flv}
\saveNamedPath{summertime}{\myRMFiles/Summertime.mp3}
\end{dCmd*}
We first define a path to our resources, then save those paths along with the file names.

You can use \cs{defineRMPath} to define URLs as well
{\small
\begin{dCmd*}{\linewidth}
\defineRMPath{\myRMURLs}{http://www.example.com/~dpspeaker/videos}
\end{dCmd*}
}
Now, \cs{myRMURLs} points to your common video resources on the Internet.




\subsection{Creating Posters}\label{createPosters}

The \cs{rmAnnot} command has a \texttt{poster} key that is
recognized as part of optional key-value pairs. The use of the
\texttt{poster} key is optional, if you do not specify one, one will
be generated for you. (More on the default poster appearance is
presented below.) The poster image is visible when the rich media
annotation is not activated.

To create a poster for your rich media annotation, use a graphics
application (Adobe Illustrator, Adobe Photoshop, etc.), and save as
an EPS file. Move this file to your source file folder. Let's call
this file \texttt{cool\_poster.eps}. In the preamble place the command
\begin{dCmd*}{.5\linewidth}
\makePoster{myCP}{cool_poster}
\end{dCmd*}
The first argument is a \emph{unique name} for the graphic, the
second argument is the path name of the graphic (without the
extension). The name is used as the value of the \texttt{poster}
key.

The command actually has an optional first argument. This argument
is passed to the command \cs{includegraphics} (of the \texttt{graphicx}
package). The general syntax of the command is
\begin{dCmd}{\linewidth}
\makePoster[<options>]{<name>}{<path_to_EPS>}
\end{dCmd}
The command uses the \texttt{graphicxsp} package to embed the file
in the PDF document. The graphical image can then be used multiple
times in many annotations.

The graphic itself should have the same \emph{aspect ratio} as the rich
media annotation; this is important if the graphic contains text or
images that would get otherwise distorted.

Example,

\begin{dCmd*}{.75\linewidth}
\rmAnnot[poster=myCP]{200bp}{200bp}{mySWF}
\end{dCmd*}
See \Nameref{rmAnnot} for additional discussion of the \texttt{poster}
key and \cs{rmAnnot}.

\paragraph*{Default Poster Image.} The \texttt{rmannot} package has
default poster appearance. This poster appearance takes one of two
forms. If the media file is \textsf{MP3}, an image of the AudioPlayer control
bar is used; otherwise it is dynamically generated (with the correct
dimensions) using the following PostScript operators:
\begin{dCmd*}{.8\linewidth}
\defaultPoster
{%
    .7529 setgray
    0 0 \this@width\space\this@height\space rectfill
    10 \adj@measure 10 \adj@measure moveto .4 setgray
    /Helvetica \this@height\space 10 div selectfont
    (\rma@posternote) show
}
\end{dCmd*}
The commands \cs{this@width} and \cs{this@height} are the width and
height of the annotation. The command \cs{adj@measure} converts a
measurement to a proportion of the smaller of the two measurements
\cs{this@width} and \cs{this@height}.\footnote{The code presented
here is a simplified version of the actual code found in
\texttt{rmannot.dtx}. The definition of the default poster has a
number of macros that can be redefined to change the placement of
text, the color, size of the font, etc. See \texttt{rmannot.dtx}
for details.}

Note that, in the above code, some text is generated in the lower
left corner of the annotation, the text is \cs{rma@posternote}. This
command is populated by the value of the \texttt{posternote} key of
the optional argument of \cs{rmAnnot}. The default value of
\texttt{posternote} is \texttt{AcroTeX Flash} or \texttt{AcroTeX
Video}, depending on the file type of the media. This can be changed
through the \texttt{posternote} key.

The default poster itself can be redefined by a document author who
is schooled in PostScript things, perhaps if only to change colors,
or font, or location of the poster note.

\section{\texorpdfstring{\protect\cs{rmAnnot}}{\CMD{rmAnnot}} and its Options}\label{rmAnnot}

The \cs{rmAnnot} command creates a rich media annotation, new to
version 9 of \textbf{Acrobat}/\textbf{Adobe Reader}. Media files (\textsf{SWF}, \textsf{FLV}, or \textsf{MP3})
can be either embedded in the document, or linked via a URL, and
played. \textbf{Acrobat}/\textbf{Adobe Reader} have a built-in Flash player that plays
\textsf{SWF}, \textsf{FLV} and \textsf{MP3} files.

\goodbreak
Media files in other formats need to be converted to one of these
three supported formats.\footnote{The new \textbf{Acrobat 9 Pro Extended} can
convert media files to \textsf{FLV}, but embed the converted file in the PDF,
so we cannot really use that re-encoded file with our
\texttt{rmannot} package. Adobe Flash Video Encoder converts many
movie formats to \textsf{FLV} format, which can, in turn, be used in this
package. Other utilities may be available as shareware or
commercialware.}

\subsection{\texorpdfstring{\protect\cs{rmAnnot}}{\CMD{rmAnnot}} Command}

The primary command of this package is \Com{rmAnnot}, which has four
arguments, one optional and three required.
\begin{dCmd}{.75\linewidth}
\rmAnnot[<options>]{<width>}{<height>}{<name>}
\end{dCmd}
The \texttt{<width>} and \texttt{<height>} parameters are what they
are, the width and height to be used in the rich media annotation.
The aspect ratio should be the same as the aspect ratio of the
Flash media. The annotation can be resized using either
\cs{resizebox} or \cs{scalebox} of the \texttt{graphicx} package to
get the physical dimensions you want.

\textbf{For \textsf{MP3} Files.} After a careful measurement, the aspect
ratio (width/height) of the \textsf{MP3} \texttt{AudioPlayer} control bar is
about 9.6. In some of the demo files, I've been using a width of
\texttt{268bp} and a height of \texttt{28bp}, and resize the
annotation to what is desired. Use \texttt{268bp} and \texttt{28bp}
for the width and height of an \textsf{MP3} file, and resize.

The \texttt{<name>} argument references a media file defined by the
\cs{saveNamedPath} in the preamble.

The \texttt{<options>} are discussed in the subsection that follows.

\subsubsection{\texorpdfstring{\protect\cs{rmAnnot}}{\CMD{rmAnnot}} Options}

The \cs{rmAnnot} command has many key-value pairs that are passed to
it through its first optional argument. Most of these key-value
pairs correspond to options available through the user interface of
\textbf{Acrobat}. Below is a listing of the key-values, and a brief
description of each.

\begin{itemize}
    \item\texttt{name}: The name of the annotation. If none is
        supplied, then \verb!aebRM\therm@Cnt! is used, where
        \texttt{rm@Cnt} is a {\LaTeX} counter that is incremented each
        time \cs{rmAnnot} is expanded.

    \item\texttt{enabled}: The enabled key determines when the
        annotation is activated, possible values are \texttt{onclick},
        \texttt{pageopen}, and \texttt{pagevisible}.
    \begin{itemize}
        \item \texttt{onclick}: The annotation is activated when the
            user clicks on the annotation, or is activated through
        JavaScript.
        \item \texttt{pageopen}: The annotation is activated when
            the page containing the annotation is opened.
        \item\relax\texttt{pagevisible}: The annotation is activated
            when the page containing the annotation becomes visible.
            (Useful for continuous page mode.)
    \end{itemize}
    The default is \texttt{onclick}.

    \item\texttt{deactivated}: The enabled key determines when the
        annotation is activate, possible values are \texttt{onclick},
        \texttt{pageopen}, and \texttt{pagevisible}.
    \begin{itemize}
        \item \texttt{onclick}: The annotation is deactivated by
            user script or by right-clicking the annotation and choosing
            Disable Content.
        \item \texttt{pageclose}: The annotation is deactivated when
            the page containing the annotation is closed.
        \item \texttt{pageinvisible}: The annotation is deactivated
            when the page containing the annotation becomes invisible.
            (Useful for continuous page mode.)
    \end{itemize}
    The default is \texttt{onclick}.

    \item \texttt{windowed}: A Boolean, which if \texttt{true}, the
        media is played in a floating window. The default is
        \texttt{false}, the media is played in the annotation on
        the page. For information on how to set the floating
        window parameters, see \mlNameref{winparams}.
    \item \texttt{url}: A Boolean, which if \texttt{true}, the media
        is to be interpreted as an URL. The default is \texttt{false},
        the media is embedded from the local hard drive and embedded in
        the PDF file.
    \item \texttt{borderwidth}: The borderwidth determines whether a
        border is drawn around the annotation when it is activated.
        Possible values are \texttt{none}, \texttt{thin},
        \texttt{medium}, and \texttt{thick}. The default is \texttt{none}.
    \item \texttt{poster}: The name of a poster graphic created by
        \cs{makePoster}. See the section \Nameref{createPosters} for
        additional details.
    \item \texttt{posternote}: When the poster key is not given, the
        default poster is generated. A short note of text appears in the
        lower left-corner. The text for that note can be passed to the
        default poster appearance through \texttt{posternote}. See
        \mlNameref{createPosters} for additional details.
    \item \texttt{invisible}: A Boolean which, if present, \textsf{rmannot}
        creates a transparent poster for the RMA. The RMA has not hidden
        property as form fields do, the best you can do is to give the RMA
        a transparent poster and place it in an obscure corner of the
        page, or under a form field. Normally, if invisible is specified,
        the video content is played in a window (that is,
        \texttt{windowed} is specified as well).
        \item[] \textbf{Note:} The \texttt{invisible} option requires that
        you distill the document with a job options setting of
        \texttt{Standard\_transparency}, distributed with the \textsf{graphicxsp}
        package.
    \item \texttt{transparentBG}: This option is available for \textsf{SWF}
        files only. Quoting the \emph{Adobe Supplement}
        document, ``A flag that indicates whether the page
        content is displayed through the transparent areas of
        the rich media content (where the alpha value is less
        than 1.0). If \texttt{true}, the rich media artwork is
        composited over the page content using an alpha channel.
        If false, the rich media artwork is drawn over an opaque
        background prior to composition over the page content.''
        The default is \texttt{false}.
    \item \texttt{passcontext}: A Boolean, if \texttt{true}, passes
        right-click context to Flash. Should be used only if there is a
        way of deactivating the annotation, perhaps through JavaScript.
        Recognized only for \textsf{SWF} files. The default is \texttt{false}.

        \textsf{SWF} file developers can select this option to replace the
        Acrobat context menu with the context menu of the
        originating \textsf{SWF} file. When the user right-clicks the \textsf{SWF}
        file, the available options are from the originating file.

    \item \texttt{skin}: For playing a \textsf{FLV} file, seven different
        skins are available for the user to control the video,
        \texttt{skin1}, \texttt{skin2}, \texttt{skin3}, \texttt{skin4},
        \texttt{skin5}, \texttt{skin6}, and \texttt{skin7}. Another
        possible value is \texttt{none}, for no skin. In the latter
        case, the media is played when activated, but there is no user
        interface to control the play. As for the description of each of
        the skins,
    \begin{itemize}
        \item \texttt{skin1}: All Controls
        \item \texttt{skin2}: Play, Stop, Forward, Rewind, Seek, Mute, and Volume
        \item \texttt{skin3}: Play
        \item \texttt{skin4}: Play and Mute
        \item \texttt{skin5}: Play, Seek, and Mute
        \item \texttt{skin6}: Play, Seek, and Stop
        \item \texttt{skin7}: Play, Stop, Seek, Mute, and Volume
        \item \texttt{none}: No Controls
    \end{itemize}

    \item You can add other skins as well. If you have \textbf{Adobe Flash
    Professional CS5}, you have access to other skins. Place a new skin in
    the location Acrobat expect them to be in (as defined by
    \cs{PathToSkins}, then place a declaration like the following in the
    preamble of your document:
\begin{Verbatim}
\saveNamedPath{skin8}{\PathToSkins/%
    MinimaUnderPlayBackSeekCounterVolMuteNoFull.swf}
\end{Verbatim}
(Here, I've wrapped the line around for display purposes.) Now, when you
use \cs{rmAnnot}, you can specify \texttt{skin=skin8} as a key-value in the optional
parameter list.

    \item \texttt{skinAutoHide}: A Boolean, if \texttt{true}, the skin auto hides.
        Only valid for \textsf{FLV} files.
    \item \texttt{skinBGColor} The color of the skin. The value is a color in hex format.
    The default is \texttt{0x5F5F5F}.  Only valid for \textsf{FLV} files.
    \item \texttt{skinBGAlpha}: The alpha level of the skin, a number between 0 and 1. The default
    is 0.75. Only valid for \textsf{FLV} files.
    \item \texttt{volume} The initial volume level of the video
    file, a number between 0 (muted) and 1
    (max volume). The default is 1.0. Only valid for \textsf{FLV} files.
%    \item \texttt{speed}: Description quoted from the \textsl{Adobe
%        Supplement} document. ``A positive number specifying the speed to be used
%        when running the animation. A value greater than one shortens
%        the time it takes to play the animation, or effectively speeds
%        up the animation.'' The default is 1.
%    \item\texttt{playcount}: Description quoted from the \textsl{Adobe
%        Supplement} document. ``An integer specifying the play count for
%        this animation style. A nonnegative integer represents the
%        number of times the animation is played. A negative integer
%        indicates that the animation is infinitely repeated.'' The
%        default is -1.
    \item\texttt{cuepoints}: If the video is encoded with cue points, you
    can associate a JavaScript action with each. The value of \texttt{cuepoints}
    is a comma delimited list of cue points. See the paragraph
    \Nameref{cuepoints} for more details.
    \item \texttt{resources}: Use this key to list all files that
        are required to run a \textsf{SWF} file.  The value of the resources key
        is a comma delimited list of path names created by the \cs{saveNamedPath}
        command. \emph{The files referenced within this key are embedded in the PDF.}
        Files that are on the Internet---and are played from the Internet---should not be listed here.
    \item \texttt{flashvars}: Flash developers can use the \texttt{flashvars}
    key to add ActionScript variables for the \textsf{SWF} file. See the discussion
    of \textit{{\NoHyper\nameref{NameCmds}}} below.
\end{itemize}

\paragraph*{Some Name commands.}\label{NameCmds} Within the optional parameters of the \cs{rmAnnot}
command, two convenience commands, \Com{Name} and \Com{urlName}, are
defined. They can be used, for example, with the \texttt{flashvars} key.

The \cs{Name} command may be used to set the value of a flash
variable. \cs{Name} has one argument, the symbolic name of a file
embedded by \cs{saveNamedPath}. The expansion of
\verb!\Name{<name>}! will appear in the Resources tab of the Edit
Flash dialog box. For example, if we define \texttt{myVid} as
\begin{Verbatim}[fontsize=\small]
    \defineRMPath{\myRMFiles}{C:/acrotex/video}
    \saveNamedPath{myVid}{\myRMFiles/assets/myVid.flv}
\end{Verbatim}
then \verb!\Name{myVid}! expands to \texttt{myVid.flv}. If the path is grouped
with braces, like so,
\begin{Verbatim}[fontsize=\small]
    \saveNamedPath{myVid}{\myRMFiles/{assets/myVid.flv}}
\end{Verbatim}
then \verb!\Name{myVid}! expands to \texttt{assets/myVid.flv}. This latter form
corresponds to adding a directory using the Add Directory button on the
Resources tab of the Edit Flash dialog box.

We can then use \cs{Name} as follows:
\begin{Verbatim}
    \rmAnnot[flashvars={source=\Name{myVid}},
        resources={myVid}]{320bp}{240bp}{mySWF}
\end{Verbatim}
where mySWF is the name of an \textsf{SWF} application that takes a flash variable named \texttt{source}, the value
of the variable is the video to be played.

The \cs{urlName} command is designed for resources on the Internet, and which are passed to the
\textsf{SWF} application with a flash variable.
\begin{Verbatim}[fontsize=\small]
    \defineRMPath{\myRMURLs}{http://www.example.com/~dpspeaker/videos}
    \saveNamedPath{myVid}{\myRMURLs/myVid.flv}
\end{Verbatim}
The expansion of \verb!\urlName{myVid}! is
\begin{verbatim}
    http://www.example.com/~dpspeaker/videos/myVid.flv
\end{verbatim}
We can then use \cs{urlName} as follows:
\begin{Verbatim}
    \rmAnnot[flashvars={source=\urlName{myVid}
    }]{320bp}{240bp}{mySWF}
\end{Verbatim}
Note that we don't list \texttt{myVid} as a resource, we just pass the URL to
\texttt{mySWF} as a flash variable.

\textbf{Note.} The \cs{Name} and \cs{urlName} commands are defined within
the optional parameters of Acrobat form fields created by the \textsf{eforms}
package.

\paragraph*{On Cue Points.}\label{cuepoints} A cue point is any significant
moment in time occurring within a video clip. Cue points can be embedded
in the \textsf{FLV} using \textbf{Adobe Flash Professional}, or some other video encoder.

The value of the \texttt{cuepoints} key is a list of cue points data, a
``typical example'' is
\begin{Verbatim}[fontsize=\footnotesize]
\newcommand{\myCuePoints}{%
    {type=nav,name=Chapter1,time=0,action={console.println("Chapter1")}},%
    {type=nav,name=Chapter2,time=1883,action={console.println("Chapter2")}},%
    {type=nav,name=Chapter3,time=5197,action={console.println("Chapter3")}},%
    {type=nav,name=Chapter4,time=6817,action={console.println("Chapter4")}},%
    {type=nav,name=Chapter5,time=9114,action={console.println("Chapter6")}},%
    {type=nav,name=Chapter6,time=12712,action={console.println("Chapter6")}}
}
\end{Verbatim}
\textbf{\textcolor{red}{Comments:}} Having made such a definition, we then say
\verb!cuepoints={\myCuePoints}!, note that \cs{myCuePoints} must be enclosed in
braces. Note also in the above example, that the comment character
(\texttt{\%}) is used after each comma (\texttt{,}) in a line break. Because of the way the
argument is initially parsed, these comment characters are needed.

Each of the cue points is a comma-delimited list of key-value pairs; the
keys are \texttt{type}, \texttt{name}, \texttt{time}, and \texttt{action}.
Each of these are briefly described.

\begin{itemize}
    \item \texttt{type}: Possible values for this key are \texttt{nav} and
    \texttt{event}, and describes the type of cue point this is.
    \begin{itemize}
        \item \texttt{type=nav}: Navigation cue points enable users to seek
        to a specified part of a file. Embed Navigation cue points in the
        \textsf{FLV} stream and \textsf{FLV} metadata packet when the \textsf{FLV} file is encoded.

        \item[] Navigation cue points create a keyframe at the specified
        cue point location, so you can use code to move a video player’s
        playhead to that location. You can set particular points in an \textsf{FLV}
        file where you might want users to seek. For example, your video
        might have multiple chapters or segments, and you can control the
        video by embedding navigation cue points in the video
        file.\footnote{Taken in part from
        \url{http://www.peachpit.com/articles/article.aspx?p=663087}}
    \item \texttt{type=event}: Event cue points can also be embedded in
    your \textsf{FLV} stream and \textsf{FLV} metadata packet when video clip is encoded.
    You can write code to handle the events that are triggered at
    specified points during \textsf{FLV} playback.\footnote{Ibid.}
    \end{itemize}
    \item \texttt{name=<name>}: The name of the cue point
    \item \texttt{time=<time>}: The time in milliseconds the cue point
    occurs.
    \item \texttt{action=<JS\_action>} The JavaScript code that is executed
    when this cue point is reached.
\end{itemize}


\subsubsection{Setting the Floating Window Parameters}\label{winparams}

When the \texttt{windowed} key is set to \texttt{true}, the rich
media annotation appears in a floating window. Use the
\Com{setWindowDimPos} command to set the dimensions of the window
and its positioning.

\begin{dCmd}{.67\linewidth}
\setWindowDimPos{<key-value pairs>}
\end{dCmd}
\CmdLoc This command may be placed anywhere and will take affect for the next rich media annotation
created by \cs{rmAnnot}.

\PD There are a number of key-value pairs for setting the floating window; the default values are
normally adequate for most applications.

\begin{itemize}
\item\texttt{width}: The width is described by three \emph{key-value pairs}, \texttt{default},
    \texttt{max}, and \texttt{min}, measured in default user space units. Default values:
    \texttt{default}: \texttt{288}, \texttt{max}:\texttt{576}, \texttt{min}: \texttt{72}.

    For example, \verb!width={default=300,max=600,min=80}!.

\item\texttt{height}: The height is described by three \emph{key-value pairs}, \texttt{default},
    \texttt{max}, and \texttt{min}, measured in default user space units. Default values:
    \texttt{default}: \texttt{216}, \texttt{max}:\texttt{432}, \texttt{min}: \texttt{72}.

    For example, \verb!height={default=300,max=600,min=80}!.

\item\texttt{position}: The position of the floating window is
    described by four key-value pairs.
\begin{itemize}
    \item\texttt{halign}: The \texttt{halign} parameter describes
        the horizontal alignment of the window. Valid values are
        \texttt{near}, \texttt{center} and \texttt{far}. The
        default is \texttt{far}. For languages that read from
        left-to-right, a value of \texttt{near} refers to the left
        edge of the viewing window; whereas \texttt{far} refers to
        the right edge of the viewing window. (For right-to-left
        reading languages, the description of \texttt{near} and
        \texttt{far} are reversed.)

    \item\texttt{valign}: The \texttt{valign} parameter describes
        the vertical alignment of the window. Valid values are
        \texttt{near}, \texttt{center} and \texttt{far}. The default is
        \texttt{near}.

    \item\texttt{hoffset}: The description of \texttt{hoffset} is
        paraphrased from the \textsl{Adobe Supplement} document: The
        offset from the alignment point specified by the \texttt{halign}
        key. A positive value for \texttt{hoffset}, when \texttt{halign}
        is either \texttt{near} or \texttt{center}, offsets the position
        towards the \texttt{far} direction. A positive value for
        \texttt{hoffset}, when \texttt{halign} is \texttt{far}, offsets
        the position towards the \texttt{near} direction. The default is~18.
    \item\texttt{voffset}: The description of \texttt{voffset} is
        paraphrased from the \textsl{Adobe Supplement}
        document: The offset from the alignment point
        specified by the \texttt{valign} key. A positive
        value for \texttt{voffset}, when \texttt{valign} is
        either \texttt{near} or \texttt{center}, offsets the
        position towards the \texttt{far} direction. A positive value
        for \texttt{voffset}, when \texttt{valign} is \texttt{far}, offsets the
        position towards the \texttt{near} direction. The default is~18.
\end{itemize}
\end{itemize}
In layman's terms the combination of \texttt{halign=far, valign=near} puts
the floating window in the upper right corner of the active window of
Adobe Reader/Acrobat, assuming a left-to-right reading language.  The
values of \texttt{voffset=18,hoffset=18}, moves the floating window 18
points down and 18 points to the left. That would be its initial position.

\textbf{\textcolor{red}{Note}}: This feature, the positioning of the
window, never worked in Version~9, but has been implemented for
Version~10.

The \Com{resetWindowDimPos} command can be used to reset the
floating window parameters to their default values.


\begin{dCmd}{.5\linewidth}
\resetWindowDimPos
\end{dCmd}

\subsection{Examples}

In this section, several examples are presented that illustrate the \cs{rmAnnot}
and some of the key-value pairs.

\subsubsection{Posters}

The poster is an image that is displayed when the rich media annotation is not activated.
If a poster is not specified using the \texttt{poster} key, one is supplied for it.
Consider the following Flash animation.
\begin{center}
    \resizebox{!}{.75in}{\rmAnnot{612bp}{265bp}{AcroAd}}\quad
    \resizebox{!}{.75in}{\rmAnnot[poster=AcroAd_poster]{612bp}{265bp}{AcroAd}}%
\end{center}
Above are two rich media annotations, each running the same \textsf{SWF}
file. The one on the left uses the default poster, the one on the
right uses a custom poster. In the annotation on the left, you see
the default \texttt{posternote}, this can be changed using the
\texttt{posternote} key.

The custom poster was obtained by viewing the \textsf{SWF} file in Adobe
Flash Player~9, then printing one of the frames to Adobe PDF,
cropping the PDF, then saving the resulting PDF as an EPS file.
After you crop the printed image, you can determine its dimensions
by moving your mouse to the lower-left corner; the width and height
values should appear. Use these in setting up your annotation.

The verbatim listing for the two above annotations is found below.
\begin{dCmd*}{\linewidth}
\begin{center}
    \resizebox{!}{.75in}{\rmAnnot{612bp}{265bp}{AcroAd}}\quad
    \resizebox{!}{.75in}{%
        \rmAnnot[poster=AcroAd_poster]{612bp}{265bp}{AcroAd}}
\end{center}
\end{dCmd*}
The poster \texttt{AcroAd\_poster} was defined in the preamble of this document.

Below is the same video, the one on the left is a generic poster
created from a {\LaTeX} source file, then saved as an EPS file, the
one on the right was obtained from the poster page generated by
\textbf{Acrobat}. (See the paragraph below,
\hyperref[acroposter]{page~\pageref*{acroposter}}, for details on
how this was done.)
\begin{center}
\resizebox{2in}{!}{%
    \rmAnnot[poster=aebmovie_poster]{209bp}{157bp}{horse1}}\quad
\resizebox{2in}{!}{%
    \rmAnnot[poster=horse1_poster]{209bp}{157bp}{horse1}}
\end{center}
The verbatim listing for the two above annotations follows:
\begin{dCmd*}{\linewidth}
\resizebox{2in}{!}{%
    \rmAnnot[poster=aebmovie_poster]{209bp}{157bp}{horse1}}\quad
\resizebox{2in}{!}{%
    \rmAnnot[poster=horse1_poster]{209bp}{157bp}{horse1}}
\end{dCmd*}
Posters and media files are embedded only once, so using the same
poster and/or media file multiple times does not increase the file
size significantly.

For \textsf{MP3} files, the default poster is an EPS file that is an image of
the player control bar, the example below shows the \textsf{MP3} poster and audio
player.
\begin{center}
        \resizebox{!}{14bp}{\rmAnnot{268bp}{28bp}{trek}}
\end{center}
The code for the above annotation follows:
\begin{dCmd*}{.75\linewidth}
\resizebox{!}{14bp}{\rmAnnot{268bp}{28bp}{trek}}
\end{dCmd*}
A custom poster can be inserted using the \texttt{poster} key, as
usual.

\paragraph*{The Acrobat Pro generated poster.}\label{acroposter}
To acquire the same poster image that \textbf{Acrobat} generates,
use the following steps:
\begin{enumerate}
    \item Open \textbf{Acrobat}
    \item Drag and drop your \textsf{SWF} or \textsf{FLV} file onto an empty
        \textbf{Acrobat} window
    \item Press \textbf{Ctrl-P}, or select {File > Print}
    \item Select \textbf{Adobe PDF} as the printer
    \item Select \textbf{Choose paper source by PDF page size}
    \item Select \textbf{Use custom paper size when needed}
    \item Press \textbf{OK}
    \item A new PDF should be created, and it should be the same
        size as the poster image
    \item Choose {File > Save As}, select \texttt{Encapsulated
        PostScript (*.eps)} as the \textbf{Save as type}
    \item Press \textbf{Save}, and save to an appropriate folder.
\end{enumerate}

\subsubsection{Skin Options}

When a \textsf{FLV} video file is used, the video is played by the
VideoPlayer.swf and uses one of the seven standard skins.
Customizing information is actually passed using FlashVars. (For \textsf{FLV}
files, the user does not have access to the FlashVars, the
application, in this case, this package, uses the FlashVars.)
Customizing options include a choice of skin, setting the auto hide
flag, a choice of the color of the skin, setting the opacity of the
skin and setting the initial volume level. The following illustrates
some of the options on a short \textsf{FLV} video with a horse theme.
\begin{center}
\resizebox{2in}{!}{\rmAnnot[posternote=All Controls]{209bp}{157bp}{horse1}}\quad
\resizebox{2in}{!}{\rmAnnot[posternote={skin6: Play, Seek, Stop},skin=skin6,
    skinBGColor=0xFF0000,skinBGAlpha=0.25]{209bp}{157bp}{horse1}}
\end{center}
The video on the left shows the default settings (default skin, skin
alpha, volume level, etc.), while the same video on the right uses
skin6, with skin color of \texttt{0xFF0000} (red) and skin alpha
level set to 0.25.

\begin{center}
        \setLinkText[\A{\JS{%
            var rm=this.getAnnotRichMedia({nPage: this.pageNum, cName: "acrolimerick"});\r
            if (rm.activated) rm.callAS("multimedia_play");\r
            else rm.activated=true;
        }}]{\includegraphics[width=2in]{AeB_Logo}}\\[1ex]
        \resizebox{!}{14bp}{\rmAnnot[name=acrolimerick]{268bp}{28bp}{AcroLimerick}}
\end{center}
Note, click on the {\AcroTeX} logo to play an \textsf{MP3} file.

\subsection{Third-party Video Players}

When you play an \textsf{FLV} file, the \textsf{SWF} file \texttt{VideoPlayer.swf} is
embedded in the PDF. It is \texttt{VideoPlayer.swf} that plays the \textsf{FLV}
file. It is this \textsf{SWF} file that allows us to customize the look of the RMA,
what skin to use, skin color, skin opacity, value, speed, and so on.

The \texttt{VideoPlayer.swf} file, which is shipped with Acrobat Pro, version~9 or
later, lacks several useful features, among these are the ability to play
more than one video in the same rich media annotation (RMA).

In the past year, there have been two extensions to Adobe's
\texttt{VideoPlayer.swf}:
\begin{itemize}
    \item \texttt{VideoPlayerPlus.swf} is available from Joel Geraci's web
    site \mlhref{http://blogs.adobe.com/pdfdevjunkie/2010/03/introducing_the_video_player_p.html}
    {The PDF Developer Junkie Blog}. Joel is a guru at Adobe.  Extended
    features are in the form of additional JavaScript API to play more
    than one video in an RMA, change skins, change skin color, and a few
    others. Full documentation can be found on the reference blog page.

    I have extensively tested the \texttt{VideoPlayerPlus.swf}, and it seems to
    work as advertised, no problem.

    \item \texttt{VideoPlayerX.swf} is another extension to the video
    player shipped by Adobe. This one is being developed by
    \textbf{\href{http://www.uvsar.com/projects/acrobat/videoplayerx/}{UVSAR}}.
    Full documentation can be found on this page. This player offers a
    different set of JavaScript APIs, with some overlap with Joel's
    \textbf{PlayerPlus} widget.
\end{itemize}
\textbf{Installation of third-party players.} If you want to use either or
both of these video players, download them from the appropriate web site:
\begin{itemize}
    \item \href{http://blogs.adobe.com/pdfdevjunkie/2010/03/introducing_the_video_player_p.html}
    {VideoPlayerPlus.swf}
    \item \href{http://www.uvsar.com/projects/acrobat/videoplayerx/}
    {VideoPlayerX.swf}
\end{itemize}
Joel's widget is already named \texttt{VideoPlayerPlus.swf}, but the one
from \textbf{UVSAR} is named \texttt{VideoPlayer.swf}. Rename
\textbf{UVSAR}'s widget to \texttt{VideoPlayerX.swf}. Place both
\texttt{VideoPlayerPlus.swf} and \texttt{VideoPlayerX.swf} into the same
folder that contains Adobe's \texttt{VideoPlayer.swf}. This is where the
\textsf{rmannot} package will look for them.

Once you have installed one or both widgets, \textsf{rmannot} can use them.
If you want to use either of these video players, make one of the following
declarations in the preamble
\begin{dCmd*}{.5\linewidth}
\useVideoPlayerPlus
\useVideoPlayerX
\end{dCmd*}
Choose the player that gives you the feature you most want to use.

If both are placed in the preamble, only the first one will be recognized.
No declaration at all means you are using the Adobe's
\texttt{VideoPlayer.swf}.

\redpoint On 13 Oct 2011,
\textbf{\href{http://www.uvsar.com/projects/acrobat/videoplayerx/}{UVSAR}}
published build VP10.2 of \textbf{VideoPlayX}. The new widget subsumes the
\textbf{VideoPlayerPlus} of
\mlhref{http://blogs.adobe.com/pdfdevjunkie/2010/03/introducing_the_video_player_p.html}{Joel
Geraci}. The build is targeted at Flash Player~10, so \textbf{VideoPlayX}
requires \textbf{Adobe Acrobat} or \texttt{Adobe Reader~9.2}, \textbf{Acrobat} is
required to build the document using \textsf{rmannot}, but \textbf{Reader} is only needed to view the
document. Therefore, if extended API is needed for your document, I would recommend the
use of \textbf{VideoPlayX}.

\exAeBBlogPDF{p=} Articles and examples of the use of these players are found at the
\href{\urlAcroTeXBlog}{{\AcroTeX} Blog}, articles on the
\href{\urlAcroTeXBlog/?tag=rmannot-package}{rmannot package}
illustrate each of these players; more generally, there are multiple
articles on \href{\urlAcroTeXBlog/?cat=22}{rich media annotations}.

\subsubsection{JavaScript/ActionScript API for Video Players}

Normally, we use \cs{rmAnnot} to create a RMA to play a \textsf{FLV} (or \textsf{SWF} or
\textsf{MP3}) without any controls. The user clicks on the RMA and the media
content plays. For \textsf{FLV} files, a skin may be provided to control over the
movie once the RMA becomes activated. For a fancier presentation, you
might want to create control buttons to control the movie; to do that, you
need to use the JavaScript API for the RMA.

In this section we document the JavaScript API for RMA. The resources for
this section are the \href{http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?href=JS_API_AcroJSPreface.87.1.html&accessible=true}
{JavaScript for Acrobat API Reference},
\href{http://blogs.adobe.com/pdfdevjunkie/2010/03/introducing_the_video_player_p.html}
{The PDF Developer Junkie Blog}, and \textbf{\href{http://www.uvsar.com/projects/acrobat/videoplayerx/}{UVSAR}}.

The basic methodology for passing a command to the the video player:
\begin{enumerate}
    \item \textbf{Get the RMA object.} To do this use either the
    \texttt{Doc.getAnnotRichMedia()} or \texttt{Doc.getAnnotsRichMedia()}
    methods. Note that in the latter method the word \texttt{Annots} is
    plural, the plural form distinguishes these to methods from each
    other. The former gets a single RMA object, while the latter returns
    an array of RMA objects. For work with \textsf{rmannot}, I prefer the
    use of \texttt{Doc.getAnnotRichMedia()}.

    \item[] \texttt{Doc.getAnnotRichMedia()} takes two arguments, the
    first is the page number, and second is the name (a string) of the
    annot. For example
\begin{verbatim}
    var rma = this.getAnnotRichMedia(this.pageNum, "myCoolRMA");
\end{verbatim}
The first argument is normally \texttt{this.pageNum}, which is a
JavaScript property referring to the current page.
    \item \textbf{Activate the RMA.} Use the \texttt{RMA.activated}
    property, a Boolean:
\begin{verbatim}
    rma.activated=true;
\end{verbatim}
    You can, as an alternative say, \verb|if(!rma.activated) rma.activated=true;|
    \item \textbf{Make the call(s).} Use the \texttt{callAS} method of the RMA
    object. For example, if you want to play the video, you might say,
\begin{verbatim}
    rma.callAS("multimedia_play");
\end{verbatim}
\end{enumerate}
Putting these lines together to play media, we have
\begin{verbatim}
    var rma = this.getAnnotRichMedia(this.pageNum, "myCoolRMA");
    if(!rma.activated) rma.activated=true;
    rma.callAS("multimedia_play");
\end{verbatim}
Those are the basics of making a call over the ``bridge'' to the video
player widget. In the rest of the section, we concentrate on the
JavaScript APIs, the third line above
\verb!rma.callAS("multimedia_play");!. The first argument of the
\texttt{callAS} method is a string which names the method to use. Note
that this first argument is a string. Additional argument may be used if
the multimedia method requires them.

\textbf{The Scripting Bridge between JavaScript and ActionScript.}
When a JavaScript method, such as  \verb!rma.callAS("multimedia_play")!, is
executed on the PDF side, the specified ActionScript function
\texttt{multimedia\_play()} is executed in the \textsf{SWF} widget
(for example, in \texttt{VideoPlayer.swf}). The \texttt{callAS} communicates
across what is called the ``scripting bridge'' to the ActionScript engine. For more
information on the scripting bridge, see the \textbf{\href{\urlAcroTeXBlog/?tag=scripting-bridge}
{\AcroTeX{} Blog}}.

\subsubsection{Core API}

The following methods are defined for all three players. The first
argument of the \texttt{callAS} method is a string, which names the
(ActionScript) method to use in the video player widget. The
\texttt{rmannot} package defines some convenience commands to give the
user a consistent experience between video players (\textbf{VideoPlayer},
\textbf{VideoPlayerPlus}, \textbf{VideoPlayerX}).


\begin{tabular}{>{\small}b{4in}>{\small}l@{}}
\multicolumn{1}{>{\bfseries}l}{Method/Description}&\multicolumn{1}{>{\bfseries}l}{Command}\\\hline
\texttt{multimedia\_play():void}&\cs{mmPlay}\\
Play the video or sound clip from the current location\\[6pt]
%
\texttt{multimedia\_pause():void}&\cs{mmPause}\\
Pause playback of the current media\\[6pt]
%
\texttt{multimedia\_rewind():void}&\cs{mmRewind}\\
Rewind the media clip to the beginning. This method does not pause the
clip.\\[6pt]
%
\texttt{multimedia\_nextCuePoint():void}&\cs{mmNextCuePoint}\\
Move the play head to the next cue (chapter) point\\[6pt]
%
\texttt{multimedia\_prevCuePoint():void}&\cs{mmPrevCuePoint}\\
Move the play head to the previous (chapter) point\\[6pt]
%
\texttt{multimedia\_seek(time:Number):void}&\cs{mmSeek}\\
Move the play location to an offset of time from the beginning of the media, where time is measured in
seconds.\\[6pt]
%
\texttt{multimedia\_mute():void}&\cs{mmMute}\\
Mute the audio of the media\\[6pt]
%
\texttt{multimedia\_volume(volume:Number):void}&\cs{mmVolume}\\
Set the volume level. The volume is a number between 0 and 1 inclusive. A value of 0 mutes the audio,
while a volume of 1 sets the volume level to the maximum level.
\end{tabular}

Examples of usage,\vspace{-\baselineskip}
\begin{verbatim}
    var rma = this.getAnnotRichMedia(this.pageNum, "myCoolRMA");
    if(!rma.activated) rma.activated=true;
    rma.callAS(\mmVolume, .5);  // half-volume
    rma.callAS(\mmPlay);        // and play it
\end{verbatim}

\subsubsection{API of VideoPlayerPlus}

The \textbf{VideoPlayerPlus} supports all the functions of the core API,
and adds four more functions.

\begin{tabular}{>{\small}b{4in}>{\small}l@{}}
\multicolumn{1}{>{\bfseries}l}{Method/Description}&\multicolumn{1}{>{\bfseries}l}{Command}\\\hline
\texttt{multimedia\_source(path:string):void}&\cs{mmSource}\\
Sets a new source file for the  video. The video can either be
embedded resource or a URL to streaming content.\\[6pt]
%
\texttt{multimedia\_skin(path:string):void}&\cs{mmSkin}\\
Sets a new skin file to be used by the player. This should be an
embedded resource.\\[6pt]
%
\texttt{multimedia\_skinBackgroundColor(color:uint):void}&\cs{mmSkinColor}\\
Sets a new background color for the player skin in the form of
\texttt{0xRRGGBB}.\\[6pt]
%
\texttt{multimedia\_skinAutoHide(state:boolean):void}&\cs{mmSkinAutoHide}\\
Sets the auto hide behavior for the player bar. [\texttt{true} or \texttt{false}]
\end{tabular}

Examples of usage,\vspace{-\baselineskip}
\begin{verbatim}
    var rma = this.getAnnotRichMedia(this.pageNum, "myCoolRMA");
    if(!rma.activated) rma.activated=true;
    // use embedded video as source
    rma.callAS(\mmSource, "myVideo.flv";
    // use video on web as source
//  rma.callAS(\mmSource, "http://www.example.com/myCool.flv");
    rma.callAS(\mmPlay);        // and play it
\end{verbatim}


\subsubsection{API of VideoPlayerX}

The \textbf{VideoPlayerX} redefines many of the core API, which returned
void, to methods that return meaningful information. It also adds many new
methods, with some overlap with \textbf{VideoPlayerPlus}.

In the table below, the functions marked with an `$*$' are also core functions
that have been re-defined to have a return value.

\begin{longtable}{@{}>{\small}b{4in}>{\small}l@{}}
\multicolumn{1}{>{\bfseries}l}{Method/Description}&\multicolumn{1}{>{\bfseries}l}{Command}\\\hline
\endfirsthead
\multicolumn{1}{>{\bfseries}l}{Method/Description}&\multicolumn{1}{>{\bfseries}l}{Command}\\\hline
\endhead
\texttt{multimedia\_pause():Number}${}^*$&\cs{mmPause}\\
Pause playback of the current media.\par\medskip
Returns on success: Playhead time in seconds
\\[6pt]
%
\texttt{multimedia\_mute():Number}${}^*$&\cs{mmMute}\\
Mute the audio of the media\par\medskip
Returns on success: Previous volume setting.
\\[6pt]
%
\texttt{multimedia\_volume(volume:Number):Number}${}^*$&\cs{mmVolume}\\
Set the volume level. The volume is a number between 0 and 1 inclusive. A value of 0 mutes the audio,
while a volume of 1 sets the volume level to the maximum level.\par\medskip
Returns on success: Previous volume setting.\\[6pt]
%
\texttt{multimedia\_seekCuePoint(cuePointName:String):String}&\makebox[1in+3pt][l]{\cs{mmSeekCuePoint}\hss}\\
Seeks to the named navigation cue point in an \textsf{FLV} video.\par\medskip
Returns on success: Empty string\\
Returns on error: String ERROR: xxxx where xxx is one of the standard
numeric error codes defined in ActionScript 3.0.
\\[6pt]
%
\texttt{multimedia\_setSource(url:String):String}&\cs{mmSource}\\
Sets the source for the video (a URL or a local file reference).\par\medskip
Returns on success: \texttt{local=} or \texttt{remote=} and the source in string format.\par\medskip
If the remote source cannot be played for any reason, the player automatically returns to playing the local source instead.
\\[6pt]
%
\texttt{multimedia\_setSkin(skinName:String):void}&\cs{mmSkin}\\
Sets a new skin file to be used by the player. This should be an
embedded resource.\\[6pt]
%
\texttt{multimedia\_setSkinColor(color:uint):uint}&\cs{mmSkinColor}\\
Sets a new background color for the player skin in the form of
\texttt{0xRRGGBB}.\\[6pt]
%
\texttt{multimedia\_setSkinAlpha(alpha:uint):uint}&\cs{mmSkinAlpha}\\
Sets the background alpha for the player skin (will only take effect where
the skin supports alpha changes).\par\medskip
Returns on success: Previous alpha value.
\\[6pt]
%
\texttt{multimedia\_useLocal(isLocal:boolean):String}&\cs{mmUseLocal}\\
Switches to the local source if \texttt{isLocal} is set to \texttt{true},
or to the remote source if \texttt{isLocal} is \texttt{false}.\par\medskip
Returns on success: source filename/URL in string format.\\
Returns on error: \texttt{"NOT AVAILABLE"}.\\[6pt]
%
\texttt{multimedia\_getMetdata( attribute:String
):String}&\cs{mmGetMetaData}\\
    Returns the video metadata associated with the attribute. Valid attribute strings are
    \texttt{width}, \texttt{height}, \texttt{audiocodecid}, \texttt{videocodecid}, \texttt{framerate},
    \texttt{videodatarate}, and \texttt{duration}.\\[6pt]
%
\newpage
%
\texttt{multimedia\_getVideoState():String}&\cs{mmGetVideoState}\\
Returns the video state. The possible values for the state property are
\texttt{buffering}, \texttt{connectionError}, \texttt{disconnected},
\texttt{loading}, \texttt{paused}, \texttt{playing}, \texttt{rewinding},
\texttt{seeking}, and \texttt{stopped}.\\[6pt]
%
\texttt{multimedia\_setScaleMode(attribute:String):String}&\cs{mmSetScaleMode}\\
    Sets video scale mode. Valid attribute strings are \texttt{exactFit},
\texttt{noScale}, and \texttt{maintainAspectRatio}.\par\medskip
Returns on success: Previous value.\par\medskip
Note that if the scale mode is changed to \texttt{"maintain\-Aspect\-Ratio"}, the align
mode will be switched to ``top left'' rather that ``center''.\\[6pt]
%
\texttt{multimedia\_getVersion():String}&\cs{mmGetVersion}\\
Returns a string in the form \texttt{"NNNN fp=FFFF vp=VVVV"},
where \texttt{NNNN} is the name of the Rich Media Annotation,
\texttt{FFFF} is the version of Flash Player being used, and \texttt{VVVV} is the
version of the \textsf{VideoPlayerX} code (currently 10.2). The length of each
element is variable.\\[6pt]
%
\multicolumn{2}{l}{\large\textbf{New API for version 10.2}}\\[6pt]
%The \textsf{VideoPlayerX} now accepts all the extended ActionScript calls
%defined by Joel Geraci's \textsf{VideoPlayerPlus}
%widget.\\[6pt]
There is now event reporting to \texttt{\href{http://www.uvsar.com/projects/acrobat/videoplayerx/listener.php}{vpx\_listener()}} and calling of
\texttt{\href{http://www.uvsar.com/projects/acrobat/videoplayerx/init.php}{vpx\_init()}}
are new. Follow these two links for information on these functions.\\[6pt]
%
\texttt{multimedia\_setStageColor(color:uint):void}&\cs{mmSetStageColor}\\
Sets the background color for the Stage (the area around the video when it
isn't scaled to fit the annotation). For example,
\begin{verbatim}
var rm=this.getAnnotRichMedia(this.pageNum,"myRMA");
rm.callAS(\mmSetStageColor,0xFF00FF);
\end{verbatim}
\\[6pt]
%
\texttt{multimedia\_isLooping():Boolean}&\cs{mmIsLooping}\\
Sets if the video should loop automatically when it reaches the end of the
timeline. The default is \texttt{true}. \par\medskip
Returns on success: Previous value of the setting.\\[6pt]
%
\texttt{multimedia\_skinAutoHide(state:Boolean):void}&\cs{mmSkinAutoHide}\\
Sets the auto hide behavior for the player bar.
\end{longtable}

There are considerably more functions that are not listed here. For a full list, go
to the page \href{http://www.uvsar.com/projects/acrobat/videoplayerx/}
{VideoPlayerX: Enhanced Video Tool for Adobe Acrobat}
on the \textbf{UVSAR} web site.

\noindent\strut

\textbf{Examples of usage.}\vspace{-\bigskipamount}
\begin{Verbatim}
    var rma = this.getAnnotRichMedia(this.pageNum, "myCoolRMA");
    if(!rma.activated) rma.activated=true;
    // use embedded video as source
    rma.callAS(\mmSource, "myVideo.flv";
    // use video on web as source
//  rma.callAS(\mmSource, "http://www.example.com/myCool.flv");
    rma.callAS(\mmPlay);        // and play it
\end{Verbatim}
Note that this is the same example as for \textbf{VideoPlayerPlus}, the
function call for setting the source has a different name, but using
convenience command \cs{mmSource} allows you to use the same code for
``PlayerPlus'' and for ``PlayerX.''

\subsubsection{Methods shared by all Video Players}

The three players (\textbf{VideoPlayer}, \textbf{VideoPlayerPlus}, and
\textbf{VideoPlayerX}) all share the core API. Beyond the core API,
extended API supported by \textbf{VideoPlayerPlus} and
\textbf{VideoPlayerX} are different, but they do have some overlap. Though
there is overlap, the common methods may have different names, this is one
of the main reasons for the convenience commands. The command,
\cs{mmSource}, for example, expands to the string
\texttt{"multimedia\_source"} for \textbf{VideoPlayerPlus}, but for
\textbf{VideoPlayerX} expands to the string
\texttt{"multimedia\_setSource"}.

\textbf{Extended API Overlap:} \cs{mmSource}, \cs{mmSkin}, and
\cs{mmSkinColor}.

For either player (\textbf{VideoPlayerPlus} or \textbf{VideoPlayerX}), you
can dynamically load in a new source file (either local or remote),
designate the skin and skin color.

\textbf{\textcolor{red}{Examples.}} Again, over time, I plan posting
several example files to illustrate \textbf{VideoPlayerPlus} or \textbf{VideoPlayerX}
and their capabilities. Keep your browser set to the
\href{http://www.math.uakron.edu/~dpstory/aebblog.html}{AeB Blog}.

\subsection{\texorpdfstring{\protect\cs{rmAnnot}}{\CMD{rmAnnot}}\label{RM3D}
    and 3D}

Here is something that I've only just come to realize: If you use the user
interface (UI) of \textbf{Acrobat} and you create a 3D annotation in
\textbf{Acrobat}, then give it a \textsf{SWF} as a resource, the 3D annot
gets converted into a Rich Media annotation (RMA). Looking through the
specification as described in the \emph{Adobe Supplement to ISO 32000}, I
determined to implement this feature, and why not since most of the
structure (that of an RMA) was already in place by way of my
\textsf{rmannot} package. So, this version of \textsf{rmannot} supports
what I'll call \emph{Rich Media 3D annotation} (RM3DA).

Initially, it was not a challenge to get a 3D model to appear in a RMA
created by \textsf{rmannot}, some straight forward modifications to
\textsf{rmannot} were required with \emph{ISO 32000} as a guide. Looking
at Alexander Grahn's very fine and brilliant \textsf{movie15} package, I
saw the difficulties of defining and creating \emph{view}s through the
{\LaTeX} interface. With Alexander's permission, I gently lifted all the
really heavy code from \textsf{movie15}, and placed it in
\textsf{rmannot}. I offer up my great and humble thanks for his kindness
in allowing the use of his code (characterized by commands beginning with
\texttt{@MXV} in \textsf{rmannot.dtx}).

If you want to insert an RMA3D annotation into your document, begin by
calling the \textsf{rmannot} package with the \texttt{use3D} option
\begin{Verbatim}[xleftmargin=20pt]
\usepackage[use3D]{rmannot}
\end{Verbatim}
Using this option brings in a large amount of code to support 3D. Regular
RMAs can be created as usual, if you do not use 3D there is no reason to
use this option.

The 3D Models support by Acrobat/Adobe Reader are U3D and PRC. To
construct a RM3D, you use one of these filetypes as the fourth argument
of \cs{rmannot}, for example,
\begin{Verbatim}[xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\rmAnnot[<rmannot_opts>]{<width>}{<height>}{<3dmodel>}
\end{Verbatim}
\cs{rmAnnot} files and resources are referred to symbolically, and need to
be declared in the preamble. For example, we might declare
\begin{Verbatim}[xleftmargin=20pt]
\saveNamedPath{myDice}{c:/.../3dmodels/dice.u3d}
\end{Verbatim}
\cs{rmAnnot} parses the fourth argument, and looks at its extension. If
the extension os \texttt{.u3d} or \texttt{.prc}, the appropriate 3D
structure is generated for this annotation.

The first optional argument of \cs{rmAnnot} has two new key-value pairs,
both Boolean: \texttt{toolbar} and \texttt{modeltree}.
\begin{itemize}
    \item\texttt{toolbar}: A Boolean, which if true (the default), causes
    the 3D toolbar to appear when the annot is activated.  If
    \texttt{toolbar=false}, the toolbar does not appear when the
    annotation is activated.
    \item\texttt{modeltree}: A Boolean, which if true causes the \textbf{Model
    Tree} as viewed in the \textbf{Navigation Pane}. The default is false,
    the \textbf{Model Tree} is not displayed when the annotation is activated.
\end{itemize}
There are a large number of key-values that support RMA3D annotations,
rather than inserting them into the first optional parameter of
\cs{rmAnnot}, I've created a separate command, \cs{setRmOptions3D} for
this purpose. The command may appear appear anywhere before the RMA3D
annot it is referencing. The syntax is

\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\setRmOptions3D{<annot_name>}
{
    3DOptions={options from movie15},
    3DResources={%
      none={rName=<name1>},...,
      foreground={rName=<name2>,flashvars=<vars>},...,
      background={rName=<name3>,flashvars=<vars>},...,
      material={rName=<name4>,mName=<materialName>,flashvars=<vars>},...
   }
}
\end{Verbatim}
The command takes two arguments, the first \texttt{<annot\_name>} is the
name of the annot, as declare by the name key in the first optional
argument of \cs{rmAnnot}, like so,
\begin{Verbatim}[xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\rmAnnot[name=my3DDice,...]{4in}{3in}{myDice}
\end{Verbatim}
In the above example, we've named this annot \texttt{my3DDice}, and it is
this name we would put in as the first argument of \cs{setRmOptions3D} in
line~(1) above.

The second argument of \cs{setRmOptions3D} takes key-value pairs, but
there are only two keys: \texttt{3DOptions} and \texttt{3DResources}. Each
of these will be explained in turn.

\newtopic\textbf{\texttt{3DOptions}}: As noted in line~(3), the value of
this key are key-value pairs defined in \textsf{movie15}, appropriate to
3D models. The keys supported are \texttt{3Dbg}, \texttt{3Djscript},
\texttt{3Dcoo}, \texttt{3Dc2c}, \texttt{3Droo}, \texttt{3Daac},
\texttt{3Droll}, \texttt{3Dviews}, \texttt{3Dlights}, and
\texttt{3Drender}. See the \mlhref{http://mirror.ctan.org/macros/latex/contrib/movie15/doc/movie15.pdf}
{\textsf{movie15} documentation} for a description of these keys.

There are a couple of differences. First \texttt{3Dviews} is the
\texttt{3Dviews2} of \textsf{movie15}. Alexander Grahn had deprecated his
original \texttt{3Dviews} key, and later came up with a better format for
storing the views.  Since we are beginning anew, \texttt{3Dviews} uses the new
format as described in the \mlhref{http://mirror.ctan.org/macros/latex/contrib/movie15/doc/movie15.pdf}
{\textsf{movie15} documentation} as
\texttt{3Dviews2}.

Another difference is with the \texttt{3Djscript} key. The file
descriptor must be a symbolic name, defined by \cs{saveNamedPath} command.
The value of \texttt{3Djscript} can be a comma delimited list of
JavaScript files, for example,
\begin{Verbatim}[xleftmargin=20pt]
3DOptions={%
    ...,
    3Djscript={myScript,myTurntable},
    ...,
    ...
}
\end{Verbatim}
Again myScript and myTurntable are defined by the \cs{saveNamedPath}
command. In theory, one can build a library of general and specific JavaScripts to
do 3D work, and you can concatenate them together in this way.

The \texttt{3Dviews} key takes as its argument a views file. This is
purely a {\LaTeX} object (not used required by Distiller), to the usual
filename is needed, for example,
\begin{Verbatim}[xleftmargin=20pt]
3DOptions={%
    ...,
    3Djscript={myScript,myTurntable},
    3Dviews=dice.vws,
    ...
}
\end{Verbatim}


\newtopic\textbf{\texttt{3DResources}}: This is a key that is new, and
separate from the \textsf{movie15} keys just outlined.
\texttt{3DResources} recognizes four keys \texttt{none},
\texttt{foreground}, \texttt{background}, and \texttt{material}. The
names and values found within \texttt{3DResources} are modeled after the
\textbf{Resources} tab of the \textbf{Edit 3D} dialog box of Acrobat 9 or
later.
\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\setRmOptions3D{<annot_name>}
{
    3DOptions={options from movie15},
    3DResources={%
      none={rName=<name1>},...,
      foreground={rName=<name2>,flashvars=<vars>},...,
      background={rName=<name3>,flashvars=<vars>},...,
      material={rName=<name4>,mName=<materialName>,flashvars=<vars>},...
   }
}
\end{Verbatim}
A resource is usually a \textsf{SWF} file, but  can be a \textsf{FLV}, or
another 3D model (\texttt{.u3d}, \texttt{.prc}); \textsf{rmannot} does not
support image files are resources (\textsf{JPG}, \textsf{PNG},
etc).

\textbf{\textcolor{red}{Note:}} Convert all image files (\textsf{JPG}, \textsf{PNG},
etc) to a \textsf{SWF} for used by \textsf{rmannot}. The
conversion can be made by \textsf{Adobe Flash Professional}, or by using
\textbf{\href{http://www.swftools.org/}{SWF Tools}} (use the \textsf{jpeg2swf} and \textsf{png2swf} tools).

\texttt{SWF} files may be bound to the background, foreground, a material
of the 3D model, or not bound at all. \textsf{FLV} and 3D models must be
not bound, and listed under the \texttt{none} key.

The keys \texttt{none}, \texttt{foreground}, \texttt{background}, and
\texttt{material} may appear multiple times.

A brief description of the values of each key follows:
\begin{itemize}
    \item \texttt{none}: The value of none is a single key-value
    combination. \texttt{rName=<name>}, where \texttt{<name>} is the
    symbolic name of a resource file declared by the \cs{saveNamedPath}.
    These files can be \textsf{SWF}, \textsf{FLV}, or even another model (advanced).
    \item \texttt{foreground}: This key binds a resource to the foreground
    of the 3D scene. The \texttt{foreground} key takes at most
    two key-value pairs, only \texttt{rName} is required, the symbolic
    name of the resource. The \texttt{flashvars} key is used to pass flash
    variables to the \textsf{SWF} application.
    \item\texttt{background}: This key binds a resource to the background
    canvas of the 3D scene. The \texttt{background} key takes at most
    two key-value pairs, only \texttt{rName} is required, the symbolic
    name of the resource. The \texttt{flashvars} key is used to pass flash
    variables to the \textsf{SWF} application.
    \item\texttt{material}: This key binds a resource to a material. The
    resource name is \texttt{rName} (as defined by \cs{saveNamedPath}),
    the key \texttt{mName} is the name of the material the resource is to
    be bound to; \texttt{flashvars} is used to pass variables to the \textsf{SWF}
    application.
\end{itemize}
If a \textsf{SWF} resource is to be used as background, foreground, or a
material using 3D JavaScript (through the JS file input by the
\texttt{3Djscript} key), it must be listed through the none key.

\paragraph*{Example.}\label{RM3Dexample} We finish off this section with a simple example,

\setRmOptions3D{my3DDice}{%
    3DOptions={%
        3Droo=40,
        3Dlights=CAD,
        3Drender=Solid,
        3Dbg=1 0 0,
        3Dviews=../examples/rm3da/views/dice.vws,
   },%
   3DResources={%
        background={rName=AcroAd}
   }%
}
\rmAnnot[name=my3DDice,toolbar]{\linewidth}{3in}{myDice}

Notice the nice advertisement playing in the background of the 3D scene.
\verb!:-{)!

The verbatim listing is
\begin{Verbatim}[xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\setRmOptions3D{my3DDice}{%
    3DOptions={%
        3Droo=40,
        3Dlights=CAD,
        3Drender=Solid,
        3Dbg=1 0 0,
        3Dviews=views/dice.vws,
   },%
   3DResources={%
        background={rName=AcroAd}
   }%
}
\rmAnnot[name=my3DDice,toolbar]{\linewidth}{3in}{myDice}
\end{Verbatim}
Further examples will appear, in time, on my
\href{\urlAcroTeXBlog//?tag=rmannot-package}{{\AcroTeX} Blog}.


\bigskip

That's all for now, I simply must get back to my retirement. \dps

\end{document}

\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
d
