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

Jonathan Kew jfkthame at googlemail.com
Mon Dec 14 17:26:19 CET 2009


On 14 Dec 2009, at 16:14, 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)>>>>
> 
> i.e. the strings appear as utf-8 encoded strings

IIRC, utf-8 is the expected encoding form in xdv (assuming \special works similarly to other things like \write output)...

> (which is
> non-standard), but nevertheless my pdf viewer (evince) is happily
> showing pdf strings in UTF-8 encoding.

...but what ends up in your PDF file? I'd expect xdvipdfmx to convert the utf-8 strings from the xdv file to utf16 for PDF bookmarks, because it knows this is the correct encoding form to use there.

> 
> 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).
> 
> Best,
> v.



More information about the XeTeX mailing list