[XeTeX] hyperref 6.79n breaks xetex's (xdvipdfmx) ability to set proper page dimensions (and overrides page dimensions on pdftex)

Heiko Oberdiek oberdiek at uni-freiburg.de
Mon Dec 14 18:06:12 CET 2009

On Mon, Dec 14, 2009 at 07:14:12PM +0300, Vladimir Volovich wrote:

> Hi Heiko,
> "HO" == Heiko Oberdiek writes:
>  >> yes, thank you (and i don't even need to use "xetex" option at all -
>  >> since it appears to auto-detect xetex - just NOT using the "unicode"
>  >> option when using xetex appears to work). sorry for not finding it
>  >> out on my own.
>  HO> Not using unicode is definitely wrong, if you want to have unicode
>  HO> characters; hyperref then outputs the strings in PDFDocEncoding.
> consider the file:
> \documentclass{article}
> %\usepackage{intcalc}
> \usepackage[
> %xetex,
> %unicode,
> pdftitle={test ^^^^0442^^^^0435^^^^0441^^^^0442}
> ]{hyperref}
> \usepackage{fontspec}
> \setmainfont{Times New Roman}
> \begin{document}
> \tableofcontents
> \section{test ^^^^0442^^^^0435^^^^0441^^^^0442}
> This is a test.
> \end{document}
> if i run it with "xelatex -no-pdf test.tex", then i see inside the test.xdv:
>   pdf:docinfo<</Title(test \xd1\x82\xd0\xb5\xd1\x81\xd1\x82)/Subject()/Creator(LaTeX with hyperref package)/Author()/Producer(XeTeX 0.9995)/Keywords()>>
>   pdf:outline [-] 1<</Title(test \xd1\x82\xd0\xb5\xd1\x81\xd1\x82)/A<</S/GoTo/D(section.1)>>>>

UTF-8 inside a PDFDocEncoded string is wrong. It's a bug
in hyperref, I will remove it. PDFDocEncoding and UTF-8 cannot be mixed
without ambiguity, both encodings are using 8-bit-bytes.

> i.e. the strings appear as utf-8 encoded strings (which is
> non-standard), but nevertheless my pdf viewer (evince) is happily
> showing pdf strings in UTF-8 encoding.

Probably because of the mysterious conversion of xdvipdfmx?

> now, following your advice to enable the unicode option, i get pdf
> strings correctly encoded as UTF-16:
>   pdf:docinfo<</Title(\\376\\377\\000t\\000e\\000s\\000t\\000\\040\\004\\102\\004\\065\\004\\101\\004\\102)/Subject()/Creator(LaTeX with hyperref package)/Author()/Producer(XeTeX 0.9995)/Keywords()>>
>   pdf:outline [-] 1<</Title(\\376\\377\\000t\\000e\\000s\\000t\\000\\040\\004\\102\\004\\065\\004\\101\\004\\102)/A<</S/GoTo/D(section.1)>>>>
> BUT, i need to manually load the intcalc package before loading
> hyperref, otherwise i'm getting errors (hyperref version is v6.79n).

Thanks, a bug, it will be fixed.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>

More information about the XeTeX mailing list