[pdftex] hypertext and merged pdf

Victor Ivrii vivrii at gmail.com
Mon May 15 12:52:12 CEST 2006


On 5/15/06, Heiko Oberdiek <oberdiek at uni-freiburg.de> wrote:
> On Thu, May 11, 2006 at 09:27:47AM +0200, Cristian Manzoni wrote:
>
> > \usepackage{pdfpages}
>
> > \includepdf[pages=-]{File1}
> >
> > \includepdf[pages=-]{Article1}
> > \includepdf[pages=-]{Article2}
>
> > The new file FileTot.pdf doesn't include any hypertext links, loosing also
> > the ones from File1.pdf.
>
> pdfTeX doesn't support including links from embedded pdf images.
> Some time (years) ago Andreas Matthias had written a patch that
> adds support for some kind of links. But I don't know why it hasn't
> found its way into the official pdfTeX.
>
> > How can I generate a pdf file inheriting the hypertext of File1, Article1,
> > Article2,... ?
>
> Use other tools for merging pdf files with links.
>
> Yours sincerely
>   Heiko <oberdiek at uni-freiburg.de>
> --

The easiest way is to use Adobe Acrobat. Alternatively

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=Merged.pdf
Article1.pdf ...

However, if one merges Article1.pdf and Article2.pdf then links
Article1.pdf -> Articles1.pdf and Article2.pdf -> Articles2.pdf and
Article1.pdf -> ExternalArticles.pdf will survive but not cross
Article1.pdf -> Articles2.pdf.


P.S. I discovered that one of my papers
http://www.math.toronto.edu/ivrii/Research/preprints/IRO6.pdf

is not appreciated by gs (while could be merged using Acrobat 7.07):

% gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished3.pdf IRO6.pdf
Error: /invalidaccess in --put--
Operand stack:
   --dict:6/6(L)--   1   2   F1.1   1   --dict:9/14(L)--
--dict:9/14(L)--   --dict:11/14(ro)(L)--   --nostringval--
--dict:9/14(L)--   --dict:11/14(ro)(L)--   --nostringval--
--dict:0/5(L)--   --dict:11/14(ro)(L)--   FontInfo   --dict:0/5(L)--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--
--nostringval--   2   %stopped_push   --nostringval--
--nostringval--   --nostringval--   false   1   %stopped_push   1   3
 %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop
--nostringval--   --nostringval--   7   1   79   --nostringval--
%for_pos_int_continue   --nostringval--   --nostringval--
--nostringval--   --nostringval--   %array_continue   --nostringval--
 false   1   %stopped_push   --nostringval--   %loop_continue
--nostringval--   30152   --nostringval--   3   12   %oparray_pop
--nostringval--   false   1   %stopped_push   3   12   %oparray_pop
--nostringval--   (gstatetype)   --dict:0/0(L)--   --nostringval--
false   1   %stopped_push   --nostringval--   %loop_continue
--nostringval--   33064   --nostringval--   4   14   %oparray_pop
--nostringval--   false   1   %stopped_push   4   14   %oparray_pop
--nostringval--   (gstatetype)   --dict:2/2(L)--   --nostringval--
false   1   %stopped_push   --nostringval--   %loop_continue
--nostringval--   --nostringval--   --nostringval--   --nostringval--
 --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1122/1686(ro)(G)--   --dict:2/20(G)--   --dict:76/200(L)--
--dict:76/200(L)--   --dict:105/127(ro)(G)--   --dict:258/347(ro)(G)--
  --dict:21/24(L)--   --dict:4/6(L)--   --dict:23/31(L)--
--dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--
--dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:12/13(L)--
Current allocation mode is local
Last OS error: 2
AFPL Ghostscript 8.53: Unrecoverable error, exit code 1
AFPL Ghostscript 8.53: ERROR: A pdfmark destination page 78 points
beyond the last page 5.


The second error is only because only first 5 pages are produced. The
offending page (6) contains some graphics which was originally eps
(Maple) converted to pdf.

Any ideas how such bug could be fixed?
-- 
========================
Victor Ivrii, Department of Mathematics, University of Toronto


More information about the pdftex mailing list