We had a similar issue with vector graphics and layers that utilize transparency. I solved our problem after a long time studying the pdf ref manual and looking at pdf docs created with Illustrator. I noticed PDF's created with Ilustrator have the page containing transparent objects set to be a transparency group and set the group color space accordingly.

Here is the relevant code (VB) I use to achieve this:


Dim pp As PdfDictionary = New PdfDictionary

pp.Put(PdfName.TYPE, PdfName.GROUP)
pp.Put(PdfName.S, PdfName.TRANSPARENCY)
pp.Put(PdfName.CS, PdfName.DEVICERGB)
cb.PdfWriter.Group = pp
cb.SetDefaultColorspace(PdfName.CS, PdfName.DEVICERGB)

cb is a previously declared PdfContentByte and this code is called right after the page containing transparent objects is created with the NewPage() method.

This is the only way I could get our colors displaying the way they were meant to be viewed. Any comments as to the correctness of this approach are welcome!

Cheers,

Eliot Cline
GIS Application Developer
Go Spatial Limited
Hong Kong


----- Original Message -----
From: Leonard Rosenthol <[EMAIL PROTECTED]>
To: Post all your questions about iText here <[email protected]>
Cc:
Date: Sunday, March 18 2007 1:59 PM
Subject: Re: [iText-questions] Color looks different after drawingparticular image types
The alternative to using ICC-based (or any device independent color
model) is to explicitly add a blending colorspace to the page.

I seem to recall that Bruno was going to add that API - but not sure
if it made it or not.

Leonard

On Mar 18, 2007, at 6:51 AM, Paulo Soares wrote:

> See http://thread.gmane.org/gmane.comp.java.lib.itext.general/21023.
>
> Paulo
>
> ----- Original Message -----
> From: "Peter van Raamsdonk" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Sunday, March 18, 2007 10:23 AM
> Subject: Re: [iText-questions] Color looks different after
> drawingparticular
> image types
>
>
>> Yes, some of my images have transparency...
>>
>> Why does this affects all elements (What Bill wrote) and what can
>> you do
>> about it?
>>
>> I don't expect this behaviour. You can change the colormodel of an
>> image
>> but an image changing the colormodel of an Graphic Enviroment?
>>
>> This could be troublesome indeed :(
>>
>> Finally ironed out the images so they look like they supposed too
>> (images
>> with non default colormodel loading 20x slower, ImageIO bugs) and
>> now this
>> with the colors. I keep running into problems with colormodels.
>>
>> Humpf,
>>
>> WYSI(not always)WYG, Peter
>
>
> ----------------------------------------------------------------------
> ---
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
> share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?
> page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Sent with DeskNow Lite - Free mail & groupware server http://www.desknow.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to