[pdftex] Separation Colors with pdftex

Stephan Lehmke lehmke at ls1sol02.cs.uni-dortmund.de
Wed Apr 17 17:00:29 CEST 2002


Stephan Lehmke wrote on Thu, 11 Apr 2002 16:16:51 +0200 (MET DST)

First of all, let me thank everybody for the many helpful
answers.

Now I seem stuck...

> According to the pdf spec (1.3 section 8.5.2.2), for using
> a color space which is not rgb, cmyk or gray, one would
> need e.g. something like
> 
> /CS<xy> cs 
> <tint> scn
> 
> assuming the resource dictionary contains something like
> 
> /CS<xy> [/Separation /PANTONE#<xyz> /DeviceCMYK <tintTransform>] 
> 
> But what is a resource dictionary and how to get something 
> into it?
> 
> And does bychance anyone have the slightest idea what
> <tintTransform> should look like (for, say, returning 
> an appropriately lightened version of a CMYK approximation).


I made myself the following test file:

---------------------------------------------------------------------------

\pdfcompresslevel0

\immediate\pdfobj {<< /FunctionType 4 >> stream { pop 0.06 0.00 0.00 0.34 } 
endstream}

\pdfpageattr {/ColorSpace << /Cs42  [ /Separation /Sonderfarbe /DeviceCMYK 1 0 R 
]>>}

\pdfliteral{/Cs42 cs 1 scn}

Test   

\bye

---------------------------------------------------------------------------

First a side question: How to refer to a pdf object within
an attribute or resource specification?

If I replace

\pdfpageattr {/ColorSpace << /Cs42  [ /Separation /Sonderfarbe /DeviceCMYK 1 0 R 
]>>}

by

\pdfpageattr {/ColorSpace << /Cs42  [ /Separation /Sonderfarbe /DeviceCMYK 
\pdfrefobj\pdflastobj ]>>}

then "\pdfrefobj\pdflastobj" is inserted verbatim into the pdf file.
According to the pdftex manual, \pdfrefobj is also unexpandable,
so \edef trickery doesn't work either.



But now to my real questions.

The relevant part of the pdf file produced is

---------------------------------------------------------------------------
1 0 obj
<< /FunctionType 4 >> stream { pop 0.06 0.00 0.00 0.34 } endstream
endobj
4 0 obj <<
/Length 133       
>>
stream
1 0 0 1 72 769.887 cm
/Cs42 cs 1 scn
1 0 0 1 19.925 -9.963 cm
BT
/F1 9.963 Tf 0 0 Td[(T)83(es)-1(t)]TJ 211.583 -654.744 Td[(1)]TJ
ET
endstream
endobj
3 0 obj <<
/Type /Page
/Contents 4 0 R
/Resources 2 0 R
/MediaBox [0 0 595.273 841.887]
/ColorSpace << /Cs42 [ /Separation /Sonderfarbe /DeviceCMYK 1 0 R ]>>
/Parent 7 0 R
>> endobj
2 0 obj <<
/Font << /F1 6 0 R >>
/ProcSet [ /PDF /Text ]
>> endobj
---------------------------------------------------------------------------

and trying to load it, I get a "Could not find the color space"
error from acroread.

It seems the /ColorSpace declaration is in the wrong place.

If I move it manually into the /Resources section, i.e.
---------------------------------------------------------------------------
3 0 obj <<
/Type /Page
/Contents 4 0 R
/Resources 2 0 R
/MediaBox [0 0 595.273 841.887]
/Parent 7 0 R
>> endobj
2 0 obj <<
/Font << /F1 6 0 R >>
/ProcSet [ /PDF /Text ]
/ColorSpace << /Cs42 [ /Separation /Sonderfarbe /DeviceCMYK 1 0 R ]>>
>> endobj
---------------------------------------------------------------------------

then the pdf looks ok at least according to what I gathered from
the pdf spec.

So my first real question: What do I have to say in the pdftex
file to get it there in the first place?

When I try to load this file in acrobat reader, I get an error 
message "There was an error processing a page. There was a problem
reading this document (15)."
Needless to say, I was unable to locate an explanation of this error 
in the acrobat reader manual.

But I guess my specification of the tintTransform function is
wrong, because if I replace 

[ /Separation /Sonderfarbe /DeviceCMYK 1 0 R ]

with

[ /DeviceGray ]

and 

1 scn

with 

0.5 scn

then the result looks like expected.

But what's wrong with

<< /FunctionType 4 >> stream { pop 0.06 0.00 0.00 0.34 } endstream

?

I thought it was obvious (take the tint from the stack, push
a constant CMYK value).

I have to confess I couldn't get myself to thoroughly read the
chapter about function declarations yet, but maybe someone can spot
the error immediately?


Another side question: How to debug pdf? Neither acroread nor
ghostview give error messages which enlighten me in any way.


regards
Stephan

-- 
  Stephan Lehmke     		 Stephan.Lehmke at cs.uni-dortmund.de
  Fachbereich Informatik, LS I	 Tel. +49 231 755 6434 
  Universitaet Dortmund		 FAX 		  6555
  D-44221 Dortmund, Germany             




More information about the pdftex mailing list