[pdftex] Problem with colors in included PDF file

Heiko Oberdiek oberdiek at uni-freiburg.de
Fri Jun 13 03:10:07 CEST 2003


On Thu, Jun 12, 2003 at 02:26:14PM +0200, Piet van Oostrum wrote:

[quoting repaired]

> Heiko Oberdiek <oberdiek at uni-freiburg.de> wrote:
> 
>> The included pdf file does not set the color for the black rectangles
>> explicitly. At start of page the pdf default color is black.
>> But in your example the current color is green.
> 
> Is that what you think is happening,

You are not the first who runs into this effect. So I have already
analyzed the problem a long time ago.

> or do you have a utility to look what
> is actually in the PDF file.

Compressed streams can be uncompressed or some programs allows
the setting of the compression level, so uncompressed streams
can be generated (pdfTeX: \pdfcompresslevel, ghostscript, ...)

> If the color of the first box is really not
> explicitly set to black I think this is a bug in the generation of the PDF
> file.

It is not a bug, because there is no specification for a "EPDF".
If a PDF file is generated with the assumption that at start
of page the color is black, then this is correct, because
the PDF specification says this.
  But it is not wrong that the current color is not black,
if a PDF page is included, because this can be used as feature.
The current color can be forced to be black during the PDF page
inclusion.

> But that means that both fig2dev and epstopdf would have the same bug.

They are generating standalone PDF files, therefore the output
is correct. The question is, which parameters should be reset,
if a pdf page is included.

>> I considere it as feature that the same pdf file can be used
>> in different colors with the possibility to force a color.
> 
> Yes, but only if that is what the user means. In this case I did not mean
> that. I create my figures with xfig and that has a color selection called
> 'default' and I would expect that color to act as you describe: take the
> current color of the environment. I haven't tried that, however.

The problem is, pdfTeX is not clairvoyant: there are use cases with
a) pdf graphics that expect black as default color.
b) pdf drawings where the default color should be the current color.

Therefore I would prefer an option for pdftex.def so that the
user can change the behaviour to his needs.
To be discussed:
* Option name:
  * "black", "black=true", "black=false"
  * (default)color=black
* Default for this option: a) or b)
What do/does you/everyone prefer?

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


More information about the pdftex mailing list