[XeTeX] (x)dvipdfm(x): Link rectangle problem

Heiko Oberdiek heiko.oberdiek at googlemail.com
Wed Feb 29 01:57:14 CET 2012


Hello,

the (x)dvipdfm(x) drivers fail if the link area contains
rules or images. See the following test file (can be used
with iniTeX):

\catcode`\{=1
\catcode`\}=2

\font\rm=cmr10   
\rm

\count0=1
\shipout\hbox{%
  \hbox to 0pt{%  
    \vrule width .1pt height 10mm\relax
    \vrule width 10mm height .1mm\relax
    \hss
  }%
  \special{pdf:bann<<%
    /Type/Annot
    /Subtype/Link
    /A<</S/Named/N/NextPage>>
  >>}%
  \vrule width 0mm height 10mm\relax
  \kern 10mm\relax
  \special{pdf:eann}% 
}

\count0=2
\shipout\hbox{%
  \hbox to 0pt{%
    \vrule width .1pt height 10mm\relax
    \vrule width 10mm height .1pt\relax
    \hss
  }% 
  \special{pdf:bann<<%
    /Type/Annot
    /Subtype/Link
    /A<</S/Named/N/PrevPage>>
  >>}%
  a%
  \vrule width 0mm height 10mm\relax
  \kern 10mm\relax
  b%
  \special{pdf:eann}%
}

\count0=3
\shipout\hbox{%
  \hbox to 0pt{% 
    \vrule width .1pt height 10mm\relax
    \vrule width 10mm height .1pt\relax
    \hss
  }%
  \special{pdf:bann<<%
    /Type/Annot
    /Subtype/Link
    /A<</S/Named/N/PrevPage>>
  >>}%
  \ifx\XeTeXpicfile\undefined
    \special{pdf:image width 10mm height 10mm (s1.png)}%
  \else
    \XeTeXpicfile s1.png width 10mm height 10mm\relax
  \fi
  \special{pdf:eann}% 
}

\csname @@end\endcsname\end


Instead of s1.png an existing image file should be used.
The test file test.tex is called, e.g.:

  xetex --ini --etex test
  tex --ini test && dvipdfmx test

The problems:
* Page 1: no link
* Page 2: the link area only covers the rectangle with "a" and "b".
  The rule in between is higher than "b".
* Page 3: xdvipmx only makes a tiny link spot at the left lower corner,
  no link with dvipdfmx.
BTW, setting the width of the invisible rules from 0pt to 1mm
  does not make a difference.

Yours sincerely
  Heiko Oberdiek


More information about the XeTeX mailing list