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

Ulrike Fischer news3 at nililand.de
Mon Dec 14 11:51:41 CET 2009

Am Mon, 14 Dec 2009 13:28:55 +0300 schrieb Vladimir Volovich:

> Hi Ulrike,
>
> "UF" == Ulrike Fischer writes:
>
>  UF> I don't think that the "unicode" option should be used with xetex.
>  UF> As far as I know it is similar to inputenc and tries to translate
>  UF> 8-bit-input.
>
> option "unicode" tells hyperref to use UTF16-encoded PDF strings
> (which are used e.g. in bookmarks or in pdf title, etc), instead of the
> default PD1 encoding (since PD1 is an 8-bit encoding which is not
> capable of storing anything beyond some accented latin characters).
>
> OTOH, as far as i know, hyperref relies on active characters
> (i.e. inputenc) to convert strings to unicode, so i'm not sure how it
> is supposed to work with xetex, where inputenc is usually not used.

Yes that is what I meant. Because of this I would at first try
without the option.

>
> Does hyperref (with unicode bookmarks) work with xetex?

I don't know but this one works fine:

\documentclass{article}
\usepackage{xltxtra}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{ÄÖÜß€}
\end{document}

But I have no idea which encoding is used in the bookmarks and if it
works with chars from other part of unicode too.

>  UF> And if you are using a package or commands to set the page size you
>  UF> should disable the settings of hyperref by using the hyperref
>  UF> option "setpagesize=false"
>
> ok, that would explain why hyperref is resetting the page dimensions
> with pdftex (though i'm not sure why hyperref goes into business of
> setting page dimensions).

Well probably because a lot of people had problems with page size
when using the standard classes (like article) without geometry.

> But why is it not resetting them with xetex?

I think it does but at a different time. So now the other setting
wins. It is a bit of a problem: on the one side there are documents
which use a class like article and which doesn't set the
pdf-pagesize, on the side you have documents were the class,
geometry and hyperref (and sometimes user commands) compete to
declare (sometimes different) the page size.

Probably we will need in short time a FAQ "how to disable page size
setting in various packages" ;-).

--
Ulrike Fischer