lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix for a pdfmark issue on Ghostscript 8.xx (info and patch)


From: K. H. Man
Subject: Fix for a pdfmark issue on Ghostscript 8.xx (info and patch)
Date: Mon, 01 Sep 2003 00:50:35 +0800
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130

Hi all,

This is a patch for JK and is relevant to those who use the
Ghostscript 8.xx toolchain for making PDF files. If browseable
and clickable PDFs generated from Ghostscript is a critical
application for you, and you are experiencing destination point
problems, please do read the following.

There is a minor bug in the Lout 3.29 pdfmark generation code. The
result is that a click at a link does not reach the destination;
instead, the page after that is reached.

PS_Link*() in z49.c puts the /View pair in the wrong place. The
attached patch corrects it. The pdfmark reference has the relevant
info on page 27. The wording of the reference states that 'view
destinations' and 'named destinations' are alternatives; one or
the other, and Ghostscript apparently follows that interpretation.
In any case, the pdfmark reference does not specify behaviour
(such as the precedence of duplicated /View or /Page keys) in the
case of mixed notation, so I guess Adobe expects well-formed
pdfmarks.

With the /View in the wrong place, Ghostscript 8.xx defaults to a
null destination (/View [/XYZ 0 0 1] (in gs/src/gdevpdfm.c)) which
is nuts (it is however specified in Adobe's doc), because the
destination is set to the lower-left (bottom) of the correct page
(the second 0) and so the display then ends up showing the next
page.

I am also looking at more accurate destination points, one that
sends the user to the upper side (ury) of the destination box.
pdfmark uses the default user space for /XYZ values, so this is
gonna take a bit of work.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia
--- lout-3.29.orig/z49.c        Thu Aug 14 06:04:42 2003
+++ lout-3.29/z49.c     Sun Aug 31 13:45:52 2003
@@ -1786,8 +1786,8 @@
   /* print the link source point */
   pnl;
   fprintf(out_fp,
-    "[ /Rect [%d %d %d %d] %s %s /Subtype /Link /Dest /%s /ANN pdfmark%s",
-    llx, lly, urx, ury, "/Border [0 0 0]", "/View [ /XYZ null null null ]",
+    "[ /Rect [%d %d %d %d] %s /Subtype /Link /Dest /%s /ANN pdfmark%s",
+    llx, lly, urx, ury, "/Border [0 0 0]",
     ConvertToPDFName(name), (char *) STR_NEWLINE);
 
   /* remember it so that at end of run can check if it has an dest point */
@@ -1816,7 +1816,8 @@
   {
     /* not used previously, so print it and remember it */
     pnl;
-    p1("[ /Dest /%s /DEST pdfmark", ConvertToPDFName(name));
+    p2("[ /Dest /%s %s /DEST pdfmark", ConvertToPDFName(name),
+      "/View [ /XYZ null null null ]");
     ltab_insert(name, &link_dest_tab);
   }
   else




reply via email to

[Prev in Thread] Current Thread [Next in Thread]