[pdftex] Set background color

Heiko Oberdiek oberdiek at uni-freiburg.de
Thu Nov 21 11:19:03 CET 2002

On Wed, Nov 20, 2002 at 06:08:44PM -0800, Nath Rao wrote:

> Is there a simple way to set the background color
> in pdfTeX [...]

No, except for painting a large rectangle.

> It seems that the pdf file produced by pdftex has
> some instructions to set the background to white


> but there seems to be no way to change this at
> pdftex level.
> The only way to do this seems to be put something like
> \vbox to 0pt{\pdfliteral{r1 g1 b1 rg}
> \hrule height0pt width\hsize depth\vsize\vss
> %restore original color}
> with the usual complications to get rid of the white
> margins all around.

You can reinvent the wheel or use the LaTeX
color package with driver pdftex.def that
supports setting the background color (\setpagecolor)
and also works with plain formats by the help of

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

More information about the pdftex mailing list