[pdftex] define pdf variable and then reference it?

Hartmut Henkel hartmut_henkel at gmx.de
Thu Jun 1 19:24:55 CEST 2006


On Wed, 31 May 2006, ivo welch wrote:

> I have a strange question.  I would like to customize a large pdftex
> generated document for everyone who downloads it.  For example, I
> would like to write in the headings of each page "hello, george".
> alas, I do not want to have to re-latex for every downloader.
>
> One solution would be to turn off all pdftex compression, and then
> look for a very unusual string that I would put into the heading, and
> which would be replaced.

it's somehow possible, but ugly. E. g.

\pdfcompresslevel=0
Hello \pdfliteral direct{XYXXXXXXXXXXXXXXXXXXXXXXX}
\vfill\eject
\pdfcompresslevel=9
compressed
\bye

secret is that \pdfcompresslevel can be set on a per-page basis, so only
the 1st page would need to be uncompressed; a feature that might go
away. Another problem is that the glyphs must be there if an embedded
font is used. You can force this by \pdfincludechars. And you need a
trick for making a blank before the \pdfliteral, maybe by a white
\vrule.

Regards, Hartmut


More information about the pdftex mailing list