dvipdfvm, xdvipdfmx: wrong @xpos and @ypos under rotation

Alexander Grahn A.Grahn at hzdr.de
Thu May 2 23:38:27 CEST 2019

Hello all,

while implementing a command for the creation of PDF destinations for the
[x]dvipdfmx backends, I noticed that @xpos and @ypos are substituted with
wrong coordinate values if they are placed into a box that is subject to
rotation. Both variables are used to mark anchors and rectangles of PDF

Rotation becomes relevant if page content is typeset onto landscape pages using
the `landscape' environment provided by the lscape and pdflscape packages.

On the other hand, @xpos and @ypos behave correctly if they are subject to

The example code below demonstrates the problem. Would it be possible to fix

Thank you in advance! Kind regards,


\documentclass{article}             %xelatex
%\documentclass[dvipdfmx]{article}  %latex + dvipdfmx

\usepackage{graphicx} % \scalebox \rotatebox


      \special{pdf:obj @dest@#1 at llx @xpos}%
      \special{pdf:obj @dest@#1 at lly @ypos}%
      \special{pdf:dest (#1)
        [@thispage /FitR @dest@#1 at llx @dest@#1 at lly @xpos @ypos]}%

  \pdflink{plain}{\strut Goto `Plain Text'}
  \pdflink{scaled}{\strut Goto `Scaled Text'}
  \pdflink{rotated}{\strut Goto `Rotated Text'}\\[10ex]

  \pdfdestrect{plain}{\fbox{Plain Text}}
  \scalebox{2}{\pdfdestrect{scaled}{\fbox{Scaled Text}}}
  % not working in (x)dvipdfmx
  \rotatebox{90}{\pdfdestrect{rotated}{\fbox{Rotated Text}}}

More information about the tex-live mailing list