Bug 691531 - pdfmark cross-references do not work in PDF when viewed with Adobe Reader
pdfmark cross-references do not work in PDF when viewed with Adobe Reader
Status: RESOLVED WORKSFORME
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer
8.71
PC Windows XP
: P4 normal
Assigned To: Ken Sharp
Bug traffic
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-06 09:55 PDT by disposable593-gs
Modified: 2010-08-15 08:26 PDT (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
PDF file created with Ghostscript 9 pre-release (3.23 KB, application/pdf)
2010-08-12 15:45 PDT, Ken Sharp
Details
PDF file created with Ghostscript 8.64 (3.21 KB, application/pdf)
2010-08-15 08:14 PDT, disposable593-gs
Details
PDF file created with Ghostscript 8.71 (3.20 KB, application/pdf)
2010-08-15 08:14 PDT, disposable593-gs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description disposable593-gs 2010-08-06 09:55:32 PDT
This may be a bug of Adobe Reader (version 7.0).

After conversion of the PS code attached below to PDF with
Ghostscript 8.71, clicking the link on page 2 does not, 
as intended, transfer to page 2 when viewed with Adobe 
Reader. This problem does not occur  the PDF generated 
by Ghostscript 8.64.




/Times-Roman findfont 40 scalefont setfont

10 650 moveto
(Link to page 2 is here.) show

systemdict /pdfmark known {[/Dest /Page2 /Rect [10 630 400 710] /Subtype /Link /ANN pdfmark} if

showpage

systemdict /pdfmark known {[/Dest /Page2 /DEST pdfmark} if 

10 650 moveto
(This is page 2.) show

showpage
Comment 1 disposable593-gs 2010-08-06 09:59:34 PDT
Sorry, I accidentally hit the enter key. "link on page 2" should be "link on page 1".
Comment 2 Ken Sharp 2010-08-12 15:45:12 PDT
(In reply to comment #0)
> This may be a bug of Adobe Reader (version 7.0).
> 
> After conversion of the PS code attached below to PDF with
> Ghostscript 8.71, clicking the link on page 2 does not, 
> as intended, transfer to page 2 when viewed with Adobe 
> Reader. This problem does not occur  the PDF generated 
> by Ghostscript 8.64.

I tried the PostScript supplied using the command line:

gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out.pdf test.ps

On the current HEAD revision. The resulting PDF file has one Link annotation on page 1 with a DEST on page 2. Opening the file in Acrobat Reader 4, 5, 9 and Acrobat Professional 7 and 9, clicking the link goes directly to the destination.

I don't have Reader 7.0 to try, but if it doesn't work, then it must be a Reader bug.
Comment 3 Ken Sharp 2010-08-12 15:45:49 PDT
Created attachment 6652 [details]
PDF file created with Ghostscript 9 pre-release
Comment 4 disposable593-gs 2010-08-15 08:12:52 PDT
The Ghostscript 9 pre-release PDF file works fine in Acrobat Reader on my system (Windows XP SP3). In fact, it is practically identical to the PDF file generated by GS 8.64.

In the PDF file generated by Ghostscript 8.71, however, object numbers 12 and 13 are exchanged, and the reference is different:

  **GS 8.64 and GS 9 prerelease
      13 0 obj
      <</Page2 [12 0 R /XYZ null null null]>>endobj

  **GS 8.71
      12 0 obj
      <</Page2 [null /XYZ null null null]>>endobj

The null reference seems to cause the problem in Acrobat Reader (tested with Adobe Reader 7.0.8 and Acrobat Reader 5.0).
For reference I will attach the PDF files. These were generated with newly downloaded versions of GS 8.64 and GS 8.71:


C:\Robert\temp>gs8.71\bin\gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out8.71.pdf test.ps
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from %rom%Resource/Font/NimbusRomNo9L-Regu... 2530840 1209538 1668624 386778 1 done.

C:\Robert\temp>gs8.64\bin\gswin32c -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=out8.64.pdf test.ps
GPL Ghostscript 8.64 (2009-02-03)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusRomNo9L-Regu font from %rom%Resource/Font/NimbusRomNo9L-Regu... 2700448 1235505 7414464 6132266 1 done.
Comment 5 disposable593-gs 2010-08-15 08:14:09 PDT
Created attachment 6661 [details]
PDF file created with Ghostscript 8.64
Comment 6 disposable593-gs 2010-08-15 08:14:51 PDT
Created attachment 6662 [details]
PDF file created with Ghostscript 8.71
Comment 7 Ken Sharp 2010-08-15 08:26:01 PDT
Thanks for following up on that one, much appreciated!