[pdftex] embedfile and links to children

Victor Ivrii vivrii at gmail.com
Fri Nov 3 13:53:39 CET 2006

On 11/3/06, Heiko Oberdiek <oberdiek at uni-freiburg.de> wrote:
> On Fri, Nov 03, 2006 at 09:13:23AM +0100, Victor Ivrii wrote:
> > The source below makes foo.pdf with attached (produced separately)
> > yellow.pdf and with the link from
> >
> > "Yellow Page 3" in foo.pdf to Page 3 of its yellow child.
> >
> >
> > Now, if I replace \attachfile{yellow.pdf}  by embedfile{yellow.pdf}
> > link stops working. Am I missing something?
> Yes, the embedded file is addressed differently by the
> /N key in the dictionary /T.

> attachfile and attachfile2 attach files to a page with
> a file attachment annotation, package embedfile attaches
> files to the document, there isn't a annotation in this case.

> >      /P 0 % page that contains the file annotation, zero based index
> You can use package zref, modul abspage for referencing the absolute
> page number, see example below.

Example below works perfectly (with names yellow.pdf and blue.pdf
instead of dummy3 and foobar3.pdf) However I had both yellow.pdf and
blue.pdf had links to the parent via


and these continue working

and another to sibling

% Named destinations can be used, if the target file contain
% some (e.g. set by hyperref automatically or by the user
% via \hypertarget). Example:
%   /D(section.1)
% Other kind of referencing. The first number is the
% zero based page number in the target file.
   /D [1 /FitH 1000] % page 2
%/D (equation.2.2)  %%% MY MODIFICATION
%    /D   [8 /XYZ null null null] % page 9
/T << /R /P
/T << /R /C
% the target file is the embedded file (child),
          % see PDF specification for more complicate
          % relationships
% Currently attachfile and attachfile2 do not support embedded
% files that are not referenced by a file annotation, therefore
% the addressing scheme for file annotations is used:
  /P 0 % page that contains the file annotation, zero based index
% attachfile does not support named file annotations, thus you
% have to use the zero based index in the Annots array
% (probably this is not trivial to know, if there are more than one
% annotation).
  %  /A 0 % zero based index in the Annots array,
  /A 1    %%%%%% if secondattachment.pdf is referenced
%          % use this method, if attachfile is used
%      /A(foo) % this is the value of option annotname
             % of \attachfile, see above,
             % requires attachfile2

with /A 1 and /A 0 respectively in the second first to be attached.
These two links broke. I tried to fix them but failed.

Victor Ivrii, Department of Mathematics, University of Toronto

More information about the pdftex mailing list