% Acrobat required % use useacrobat option with pdftex and xetex if you have acrobat % ---------------- % % Instructions for compiling this file % 1. Compile this file once, but do not make into a PDF yet. % 2. Open the two files children/target1.tex and children/target2.tex % and compile these two files several times to resolve the cross- % references. Now, make into PDFs. % 3. Return to this file and compile again to input cross-reference info % and make into a PDF via distiller. % \documentclass{article} \usepackage{xr-hyper} \usepackage[% % driver=dvips, gopro, web={designiv,usesf,tight}, attachsource={tex,dvi}, attachments={% children/target1.pdf,% % AeB Attachment #1 children/target2.pdf,% % AeB Attachment #2 ../extras/aest.xls % AeB Attachment #3 }, linktoattachments, eforms ]{aeb_pro} \externaldocument[target1-]{children/target1} \DeclareDocInfo { title=The AeB Pro Package\texorpdfstring{\\[1ex]}{: }Linking to Attachments, 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{Published:} \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} \newenvironment{ssverbatim} {\par\footnotesize\verbatim} {\endverbatim\par\aftergroup\aftersverbskip} \def\AcroTeX{Acro\negthinspace\TeX} %\autolabelNum{AeST}{3} %\autolabelNum{cooltarget}{3} %\autolabelNum{attach1}{1} %\autolabelNum{attach2}{2} % % \autolabelNum[mytarget]{1} % \autolabelNum*[mytarget]{1}{New Title} % \autolabelNum*[AeST]{3}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022 beep} % \labelName{cooltarget}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022} \begin{attachmentNames} \autolabelNum{1} %\autolabelNum{2} \autolabelNum*{2}{target2.pdf Attachment File} \autolabelNum*[AeST]{3}{AeBST Components} \labelName{cooltarget}{My (cool) $|x^3|$ ~ % ''} \end{attachmentNames} % The use of \importDataObject should occur after the \texttt{attachmentNames} environment. %\def\u{\string\\u}% \begin{docassembly} var retn=\importDataObject({cName: "cooltarget",cDIPath: "aebpro_ex2.pdf"}); if ( (app.viewerVersion>7) && retn ) this.getDataObject("cooltarget").description="\aref(cooltarget)"; \end{docassembly} \def\preseti{bordercolor={0 0 1},highlight=outline,border=visible,linestyle=dashed,open=new} \begin{document} \maketitle \tableofcontents \section{Introduction} As we saw briefly in \texttt{aebpro\_ex3.tex}, it is possible to attach a document using the \texttt{docassembly} environment, as illustrated below, \begin{sverbatim} \begin{docassembly} \importDataObject({ cName: "cooltarget", cDIPath: "aebpro_ex2.pdf" }); \end{docassembly} \end{sverbatim} In the above, we use \cs{importDataObject}, set the path to be \texttt{cDIPath: "aebpro\_ex2.pdf"} (this can be absolute or relative), and give the attachment a name with \texttt{cName:} \texttt{"\cs{aref(cooltarget)}"}. The special command \cs{aref}, is used to reference the assigned name has as its argument the label name, \emph{delimited by parentheses}. The parameter \texttt{cName} in the above \texttt{docassembly} code is of particular importance. The value of \texttt{cName} is used in the names tree for embedded files. It is used to reference the attachment in the link code. After the file is imported, the value of \texttt{cName} is converted by Acrobat to Unicode. When referencing it, you must know the unicode of the value of the \texttt{cName} key. First, we insert into the preamble, the \texttt{linktoattachments} option. This brings in all the code and commands to be discussed in this document. (See the preamble of this file.) \section{Naming Attachments} For documents attached by the \texttt{attachments} option, AeB Pro assigns them ``names,'' which appear in the attachments tab of 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 embedded the file using the \texttt{docassem\-bly} environment and the \cs{importDataObject} method, then you are free to assign a name of your preference. However it is done, 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{attachmentNames} 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.} We describe these by example. In the preamble you will find \begin{sverbatim} \begin{attachmentNames} \autolabelNum{1} \autolabelNum*{2}{target2.pdf Attachment File} \autolabelNum*[AeST]{3}{AeBST Components} \labelName{cooltarget}{My (cool) $|x^3|$ ~ % ''} \end{attachmentNames} \end{sverbatim} \textbf{\color{red}Note:} 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. \begin{description} \item[\cs{autolabelNum}:] For PDFs (or other files) embedded using the \texttt{attachments} option, use the \cs{autolabelNum} command. The syntax is \begin{verbatim} \autolabelNum[