summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/rmannot/examples/rma/tst_mp3.tex
blob: 26b630eacc98c01f005fbc63b4eb80074bb12376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
\documentclass{article}
\usepackage{amsmath}
%
% the driver line is not necessary if you
% have aebpro.cfg configured to your driver.
%
\usepackage[%
%    driver=dvips,
    web={pro,tight,usesf},
    eforms,graphicxsp={showembeds}
]{aeb_pro}
\usepackage{rmannot}
\usepackage{graphicxbox}

\margins{.25in}{.25in}{24pt}{.25in} % left,right,top, bottom
\screensize{5in}{5.5in}             % height, width

\DeclareDocInfo
{
    title=The \texttt{rmannot} Package\texorpdfstring{\\[1ex]}{: } Demo of MP3 Player,
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject=Demo of the acroflex and the rmannot package,
    keywords={Adobe Acrobat, JavaScript, Adobe FLEX 3, ActionScript},
    talksite=\url{http://www.acrotex.net},
    talkdate={July 2008},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Published:}

% Place \AcroVer{11} in rmannot.cfg, or uncomment line below
%\AcroVer{11}
% The argument corresponds to the version of Acrobat you have

%
% Convenience command pointing to the rich media files, this needs
% to be edited to point to its location on your system.
%
\newcommand{\myRMFiles}{%
    C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{tardis}{\myRMFiles/tardis1.mp3}

\parindent=0pt\parskip6pt\pagestyle{empty}

\begin{document}

\maketitle

\null\vfil

\begin{center}
\Large\bfseries\color{blue}The Tardis of Dr.\ Who\\[2ex]
\makebox[\linewidth][c]{%
   \resizebox{!}{14bp}{\rmAnnot{268bp}{28bp}{tardis}%
}}
\end{center}

Above is the basic appearance of the MP3 file, basically, just the control
bar.

On the next page is a fancy version, obtained by using a graphic background.


\newpage

\begin{center}

%%BoundingBox: 0 0 528 862
%%HiResBoundingBox: 0 0 528 861.1200


\resizebox{!}{.9\textheight}{\graphicxbox{tardis}{%
  \begin{minipage}[b][861.12bp-2\fboxsep]{528bp-2\fboxsep}
\makebox[\linewidth][c]{%
    \resizebox{.67\linewidth}{!}{\rmAnnot{268bp}{28bp}{tardis}}}%
  \end{minipage}}}
\end{center}

\newpage

Currently, a rich media annotation has no hidden property, you can, however, move it off the page
and control the play using a form button or link action.

Here are examples:\makebox[0pt][r]{\resizebox{!}{5bp}
%
% We give this annot a particular name, so we can get the AnnotRichMedia
% object using the JavaScript method this.getAnnotRichMedia.
%
{\rmAnnot[name=TardisOfDrWho]{268bp}{28bp}{tardis}}\hspace{24in}}
A form field {\small\pushButton[\textSize{7}\CA{Play!}\S{S}\A{\JS{%
    var rm=this.getAnnotRichMedia({nPage: this.pageNum, cName: "TardisOfDrWho"});\r
    if (rm.activated) rm.callAS("multimedia_play");\r
    else rm.activated=true;
}}]{tardisBtn}{}{9bp}} or a link
\setLinkText[\A{\JS{%
    var rm=this.getAnnotRichMedia({nPage: this.pageNum, cName: "TardisOfDrWho"});\r
    if (rm.activated) rm.callAS("multimedia_play");\r
    else rm.activated=true;
}}]{play the tardis}!

The verbatim listing is given below.

\begingroup\footnotesize
\begin{verbatim}
Here are examples:\makebox[0pt][r]{\resizebox{!}{5bp}
{\rmAnnot[name=TardisOfDrWho]{268bp}{28bp}{tardis}}\hspace{24in}}
A form field {\small\pushButton[\textSize{7}\CA{Play!}\S{S}\A{\JS{%
    var rm=this.getAnnotRichMedia({nPage: this.pageNum, cName: "TardisOfDrWho"});\r
    if (rm.activated) rm.callAS("multimedia_play");\r
    else rm.activated=true;
}}]{tardisBtn}{}{9bp}} or a link
\setLinkText[\A{\JS{%
    var rm=this.getAnnotRichMedia({nPage: this.pageNum, cName: "TardisOfDrWho"});\r
    if (rm.activated) rm.callAS("multimedia_play");\r
    else rm.activated=true;
}}]{play the tardis}!
\end{verbatim}
\endgroup

Using the above techniques, you can also place a link around, for example, a graphic that
plays the MP3 when clicked. See the demo file \texttt{tst\_flv\_asjs.tex} for a discussion
of using Acrobat JavaScript to play a rich media clip.

\end{document}



\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]\rmAnnot{268bp}{28bp}{tardis}}