[tex-live] Making texts externally replaceable in PDFs, e.g. with sed(1)

Ulrike Fischer news3 at nililand.de
Fri Dec 14 20:20:12 CET 2018

Am Fri, 14 Dec 2018 16:50:17 +0100 schrieb Osipov, Michael:

> So for a sed(1)-based postprocessor it is virtually impossible to map 
> "<0008002700320026002c00270008>" to "%DOCID%" w/o analyzing the PDF objects.

I don't understand this. Where is the difference between
<0008002700320026002c00270008> and (%DOCID%)? Both is a quite unique

> Requesting XeLaTex to produce
>> Td[(%DOCID%)]TJ ET
> will not work

It is easy:

 \special{dvipdfmx:config z 0} %uncompress pdf

 {\fontencoding{OT1}\ttfamily \%DOCID\%

This gives -68.742 Td[(%DOCID%)]TJ in the pdf.

The chars in the raisebox are there so that the chars perhaps needed
for the replacement are also in the pdf. 

Be aware that you must exchange the same number of chars. %DOCINFO%
can be replaced by 7 other chars, but not less or more or the xref
table will be faulty.

Ulrike Fischer 

More information about the tex-live mailing list