[pdftex] display unicode string with \pdfannot

Heiko Oberdiek oberdiek at uni-freiburg.de
Fri Aug 29 14:28:14 CEST 2008


On Fri, Aug 29, 2008 at 01:35:28PM +0530, Suman_Tripathy wrote:

> The problem is I cannot use
> \pdfstringdef\ContentsString{Phrase Code = \textcopyright\texttrademark}
> I get the string from database which contains some Unicode characters.

You haven't tried it or your hyperref is too old.
\pdfstringdef implements some shortcuts from UTF-8 using
LaTeX's utf8.def or utf8x.def of package ucs.

> So I cannot use  \textcopyright etc. Instead I will get something like
> "abc{Unicode for copyright}" string. If I directly use Unicode with
> hyperref it does not work and gives the same error \PrerenderUnicode
> etc....

\documentclass{article}
\let\OrgShow\show
\usepackage{ucs}
\AtBeginDocument{\let\show\OrgShow}
\usepackage[utf8x]{inputenc}
\PreloadUnicodePage{0}
\PreloadUnicodePage{33}
\usepackage[unicode]{hyperref}[2006/08/01]
\begin{document}
Hi
\pdfstringdef\ContentsString{Phrase Code = ^^c2^^a9^^e2^^84^^a2}
\pdfannot{%
  /Subtype/Square%
  /Border[0 0 .1]%
  /C[0 0 1]%
  /T(BoilerPlate)%
  /Contents(\ContentsString)%
}
\end{document}

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


More information about the pdftex mailing list