[pdftex] Colored background for pdftex document.

Paul Isambert zappathustra at free.fr
Sat Jan 15 19:03:24 CET 2011


Le 15/01/2011 18:46, John Culleton a écrit :
> Sometimes I need to  have a colored background for an entire page. I
> use pdftex. Pstricks could be used but that adds other complications
> to the workflow.  I would prefer a vector rather than a bitmapped
> process.
>
> As many of you know already I am LaTeX-intolerant.
>
> Any suggestions?

Make sure the following \pdfliteral makes it to the box you ship out:

%%%
{
\catcode`\p=12
\catcode`\t=12
\gdef\noPT#1pt{#1 }%
}

\pdfliteral page {%
   q
   1 0 0 rg
   0 0
   \expandafter\noPT\the\dimexpr(.996264\pdfpagewidth)\relax
   \expandafter\noPT\the\dimexpr(.996264\pdfpageheight)\relax
   re f
   Q
}
%%%

"1 0 0 rg" denotes red, which you probably don't want as background 
color, but now you know how to change it (the color model is obviously RGB).
For the record, the strange calculation turns TeX's point into PS point.

Best,
Paul


More information about the pdftex mailing list