[texhax] [TexHax] Black/white colour PDF

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sat May 29 23:56:53 CEST 2010


On Thu, May 27, 2010 at 04:57:07PM +0200, Jean-Baptiste Valsamis wrote:

> When I printed my PHD, the printer was supposed to check if the pages
> contains colour or not. After that, the printer counted 240 pages in coluor
> and 10 pages in black/white.

One question is, what is black for the printer?
A test file:

\pdfoutput=1
\catcode`\{=1
\catcode`\}=2
\catcode`\#=6
\count0=1
\def\test#1{%
  \shipout\hbox{%
    \pdfliteral{#1}%
    \vrule width 10mm height 10mm\relax
  }%
  \advance\count0 by 1\relax
}
\test{}
\test{0 g}
\test{0 0 0 rg}
\test{0 0 0 1 k}
\test{1 1 1 0 k}
\def\test#1{%
  \shipout\hbox{%
    \pdfliteral{#1}%
    \vrule width 40mm height .4pt\relax
  }%
  \advance\count0 by 1\relax
}
\test{}
\test{0 G}
\test{0 0 0 RG}
\test{0 0 0 1 K}
\test{1 1 1 0 K}
\csname @@end\endcsname\end

Run it through pdftex ("pdftex -ini", "pdftex", "pdflatex")
and check the pages through your printer, which ones are "black/white",
which are considered "colored"?

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list