[dvipdfmx] pdf:dest and destination name translation

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Tue May 14 06:39:36 CEST 2019


Hi Alexander,

Can you try the command line option

  -C 0x10

which should recover the original behavior?
Alternatively you can use the special command as follows,

 \special{dvipdfmx:config C 0x10}

This destination renaming behavior causes another problem that
named destination can’t be reached from external PDF files.
 I want to consider removing this feature if no one has an objection.


Thanks,
Shunsaku Hirata

2019年5月14日火曜日 Alexander Grahn <A.Grahn at web.de>:

> Dear Shunsaku,
>
> When creating a PDF destination, dvipdfmx translates a user-provided
> destination name given in the special
>
>   \special{pdf:dest (destination name) [...]}
>
> to an internal representation, which is a sequential integer, wrapped into
> a
> PDF string: (some dest) becomes (0), (another dest) becomes (1) and so on.
>
> This is unfortunate. While translation works for Link GoTo actions,
> dvipdfmx
> fails to translate the destination name in other GoTo Action dictionaries,
> for
> example, if a GoTo action is associated with the Mouse-Up trigger of a
> Button
> Widget. Here, an invalid GoTo action is written to the PDF.
>
> Original dvipdfm and older dvipdfmx versions did not translate
> user-provided
> destination name strings, but used them verbatim. Could the original
> behaviour
> please be restored?
>
> Please find an example code at the bottom of this message.
>
> Thank you and kind regards,
>
> Alexander
> --
>
> \documentclass{article}
>
> %Link
> \protected\long\def\pdflink#1#2{%
>   \special{pdf:bann<</Subtype/Link /A<</S/GoTo/D (#1) >>>>}#2%
>   \special{pdf:eann}%
> }
>
> %Push Button
> \newcount\widcnt
> \makeatletter
> \protected\def\pdfwidget#1#2{%
>   \begingroup%
>   \sbox{0}{#2}%
>   \special{pdf:ann @wdgt\the\widcnt\space
>     width \strip at pt\wd0pt
>     height \strip at pt\ht0pt
>     depth \strip at pt\dp0pt <<
>       /Subtype/Widget/FT/Btn/Ff 65536/H/I
>       /T (wdgt\the\widcnt)
>       /AA<<
>         /U << /S/GoTo/D (#1) >> %mouse-Up action
>       >>
>     >>
>   }%
>   \special{pdf:put @fields @wdgt\the\widcnt}%
>   \global\advance\widcnt 1%
>   \usebox{0}%
>   \endgroup%
> }
> \makeatother
> \special{pdf:obj @fields []}
> \special{pdf:put @catalog <</AcroForm <</Fields @fields >>>>}
>
> %PDF Destination
> \protected\long\def\pdfdestrect#1#2{%
>   \leavevmode%
>   \begingroup%
>     \setbox0=\hbox{#2}%
>     \lower\dp0\hbox{%
>       \special{pdf:obj @dest@#1 at llx @xpos}%
>       \special{pdf:obj @dest@#1 at lly @ypos}%
>     }%
>     \copy0%
>     \raise\ht0\hbox{%
>       \special{pdf:dest (#1)
>         [@thispage /FitR @dest@#1 at llx @dest@#1 at lly @xpos @ypos]}%
>     }%
>   \endgroup%
> }
>
> \begin{document}
>   \pdflink{myDest}{\strut Link}     % works:        (myDest) --> (0)
>   \pdfwidget{myDest}{\fbox{Button}} % not ok:       (myDest) --> (myDest)
>
>   \pdfdestrect{myDest}{\fbox{\Huge Hello World!}} % (myDest) --> (0)
> \end{document}
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/dvipdfmx/attachments/20190514/245b13cc/attachment.html>


More information about the dvipdfmx mailing list