[luatex] \pdfannot in LuaLaTeX

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Nov 5 05:11:32 CET 2010


On Thu, Nov 04, 2010 at 05:20:22PM +0100, Pablo Rodríguez wrote:

> \documentclass[12pt]{minimal}
> \usepackage{fontspec}
> \setmainfont{FreeSans}
> \usepackage[pdfencoding=auto,pdftitle={????????????? ????? ????????}]{hyperref}
> \pdfstringdef{\octalcr}{\015}
> \begin{document}
> \pdfannot{/Subtype /Text /Name (Help) /T (Pablo Rodríguez) /C [1 0
> 0] /Subj (Tamaños de página y hoja) /Open true /Contents (El tamaño
> de página es carta con la página original centrada y marcas de corte
> en las páginas impares.\octalcr{}Las versiones en tamaño original y
> carta se encuentran en http://www.rosa-varela.tk</a>.)}?????????????
> ????? ????????.
> \end{document}
> 
> everything has its right encoding, but the text in the annotation is
> wrong encoded. Text is in utf-8.

The PDF specification doesn't know UTF-8.
You can use \pdfstringdef:

\pdfstringdef\TText{Pablo ...}
\pdfstringdef\SubjText{Tam...}
\pdfstringdef\ContentsText{El tam...\textCR Las versiones ...}
\pdfannot{%
  /Subtype/Text
  /Name(Help)
  /T(\TText)
  /Subj(\SubjText)
  /Contents(\ContentsText)
  ...
}

Yours sincerely 
  Heiko Oberdiek


More information about the luatex mailing list