[pdftex] Not a bug

Ross Moore ross.moore at mq.edu.au
Tue May 13 22:46:26 CEST 2014

Hi Heiko, Ramón, and others.

On 14/05/2014, at 4:14, Heiko Oberdiek <heiko.oberdiek at googlemail.com> wrote:

> On 13.05.2014 19:51, Ramón Casares wrote:
>> Sorry! You are right, balanced pairs of parentheses
>> within a string require no special treatment.
>> I was misled by the Jhove verifier and also by the
>> explanation of the macro \pdfescapestring in
>> "The pdfTEX user manual" November 23, 2010 Rev. 655:
>>    \pdfescapestring general text (expandable)

> Strictly only unbalanced parentheses need to be escaped. But it
> simplifies the code a great deal, if it does not have to
> check for balanced parentheses to exclude them from escaping.

This is what I do too, with /ActualText  and /Alt  replacement strings.
It is far easier, and safer, to encode all parentheses and backslashes than to identify just those that really need it. Otherwise, use a UTF-16 Hex encoding. It is perhaps surprising how a single misplaced character can break a whole PDF. Better safe than sorry.

The other point from this thread is that there indeed are validators that 'get it wrong'.
Ramón, can you please send a link for the one you tried?

> Yours sincerely
>  Heiko Oberdiek



More information about the pdftex mailing list