[DVIPDFMx] BUG: wrong box by pdf:annot, patch provided

Alexander Grahn A.Grahn at fzd.de
Fri Jun 13 17:46:59 KST 2008


Hi,

if a nonzero depth is given as an option to the pdf:annot special, a
wrong box will be computed.

Consider the following example:

%%%%%%%%%%
x\special{pdf:annot width 20pt depth 50pt height 30pt <</Subtype/Link>>}
\bye
%%%%%%%%%%

dvipdfmx produces a mouse sensitive area that extends from 50pt upto 20pt
below the baseline of the leading `x'. It should however extend upto
30pt above the baseline. The reason is that in the current spc_pdfm.c the
ury coordinate is computed by adding the height to the lly coordinate
instead off adding it to the y_user coordinate.

Regards,
Alexander

The following patch fixes the problem:

--- src/spc_pdfm.c	2008-06-07 11:54:38.000000000 +0200
+++ src/spc_pdfm.c.new	2008-06-13 09:57:33.000000000 +0200
@@ -577,7 +577,7 @@
     rect.llx = cp.x;
     rect.lly = cp.y - spe->mag * ti.depth;
     rect.urx = rect.llx + spe->mag * ti.width;
-    rect.ury = rect.lly + spe->mag * ti.height;
+    rect.ury = cp.y + spe->mag * ti.height;
   }
 
   /* Order is important... */



More information about the dvipdfmx mailing list