"
> 2008/2/20, Leonard Rosenthol <[EMAIL PROTECTED]>:
>>> Hmm, doesn't help :-( I tried every blend mode, but this doesn't
>>> prevent Acrobat from switching to the CMYK color space.
>>>
>>
>>         You need to set the COLORSPACE to DeviceRGB...
>
> Thanks, but how can I achieve it? I tried
>
> 1.
> ImgTemplate image2 = new ImgTemplate(template);
> PdfArray colorspace = new PdfArray();
> colorspace.add(PdfName.DEVICERGB);
> PdfDictionary ad = new PdfDictionary();
> ad.put(PdfName.COLORSPACE, colorspace);
> image2.setAdditional(ad);
>
> 2.
> PdfDictionary ad = new PdfDictionary();
> ad.put(PdfName.COLORSPACE, PdfName.DEVICERGB);
> image2.setAdditional(ad);

Stephan,


We struggled with this problem for a long time too. Our situation was
slightly different than yours in that we make heavy use of transparency
with vector graphics as opposed to transparent images.

The only way I could keep acrobat reader from changing the color space to CMYK 
was to set the entire page containing our graphics to a transparency group and 
then set the colorspace accordingly. See the VB code snippet below.

        Dim pp As PdfDictionary = New PdfDictionary


        pp.Put(PdfName.TYPE, PdfName.GROUP)

        pp.Put(PdfName.S, PdfName.TRANSPARENCY)

        pp.Put(PdfName.CS, PdfName.DEVICERGB)

        doc.Open()

        Dim cb As PdfContentByte = writer.DirectContent

        Dim tp As PdfTemplate = cb.CreateTemplate(x, y)

        'Include the below immediately after a doc.NewPage() or after creating 
a new doc as above

        cb.PdfWriter.Group = pp
        cb.SetDefaultColorspace(PdfName.CS, PdfName.DEVICERGB)
        tp.SetDefaultColorspace(PdfName.CS, PdfName.DEVICERGB) 'Not sure if 
this one is necessary

Anyway, this works for us. Maybe it will be of some help to you as well.

Cheers,

Eliot Cline
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to