[pdftex] display unicode string with \pdfannot

Suman_Tripathy Suman_Tripathy at satyam.com
Fri Aug 29 10:05:28 CEST 2008


The problem is I cannot use
\pdfstringdef\ContentsString{Phrase Code = \textcopyright\texttrademark}
I get the string from database which contains some Unicode characters. 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....
I am not expert in pdflatex and did not understand which document Vasile referred to as PDF 1.7 reference.
Thanks u all for help.
Regards,
Suman

-----Original Message-----
From: pdftex-bounces at tug.org [mailto:pdftex-bounces at tug.org] On Behalf Of Vasile Gaburici
Sent: Friday, August 29, 2008 1:23 AM
To: pdftex at tug.org
Subject: Re: [pdftex] display unicode string with \pdfannot

The experts surely make this look easy :)

On Thu, Aug 28, 2008 at 7:58 PM, Heiko Oberdiek
<oberdiek at uni-freiburg.de> wrote:
> On Thu, Aug 28, 2008 at 04:25:31PM +0300, Vasile Gaburici wrote:
>
>> Of course it doesn't work because \pdfannot takes raw PDF as input.
>> LICRs, which is what the ucs package produces for any char > 127, will
>> not do what you think. For instance:
>>
>> \pdfannot{/Subtype /Square /Border [ 0 0 0.1 ] /C [0 0 1] %
>> /T (Some title) /Contents (My text: \backslash) }
>>
>> Will produce a box with this contents:
>>
>> My Text: delimiter "026E30F
>>
>> You need to change catcodes so you can output UTF-16BE unmolested,
>> which is what PDF needs for *its* strings; see section 3.8.1 in PDF
>> 1.7 reference.
>
> Or use hyperref:
>
> \documentclass{article}
> \let\OrgShow\show
> \usepackage{ucs}
> \AtBeginDocument{\let\show\OrgShow}
> \usepackage[unicode]{hyperref}
> \begin{document}
> Hi
> \pdfstringdef\ContentsString{Phrase Code = \textcopyright\texttrademark}
> \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>


DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.


More information about the pdftex mailing list