Hi Jeremias,

Thanks for your detailed information on colored image handling in PDF Renderer.

I was actually debugging the source for this know how exactly the conversion is happening (based on the AFP Renderer experience). I found ImageRenderedAdapter class, which is using ImageEncodingHelper, but the enableCMYK flag value 'false' is being passed everytime. I have generated the output with the CMYK colored image in the PDF document, wondered how this encoding is happening without passing CMYKflag in ImageEncodingHelper.

I have debugged the source based on the Max comments, and found that ImageRawJPEGAdapter is being used instead of ImageRenderedAdapter. The ImageEncodingHelper is only being used in ImageRenderedAdapter for the images other than JPEG. I am passing JPEG CMYK image, so ImageRawJPEGAdapter is being used here in my case.

Thanks once again for giving me the direction needed...

Venkat.

Jeremias Maerki wrote:
Venkat,

you can easily answer your own questions: You're interested in PDF
output so you start in org.apache.fop.render.pdf, i.e. in the
neighborhood of the PDF Renderer. You look around and see classes like
ImageRenderedAdapter or ImageRawJPEGAdapter in that package. Smells a
lot like image handling. There's also PDFImageHandler* but they will
point you back to Image*Adapter in the end. So it seems there are three
classes of images handled here: JPEG, CCITT and Rendered. Rendered means
RenderedImage, i.e. a decoded bitmap image. JPEG and CCITT are about
undecoded image data. Both JPEG and RenderedImage allow CMYK images, so
you'll have to look at both. Going into ImageRenderedAdapter, you once
again encounter ImageEncodingHelper from XML Graphics Commons.

Last step is setting up your Java debugger, set a breakpoint in there
and you're in the middle of it.

On 16.02.2010 12:17:11 Venkat Reddy wrote:
Hi Max,

Thanks for your response.

I am looking for the classes and methods responsible in handling CMYK color images for PDF Renderer. If you know the classes and methods used in this regard, please mention them in your reply.

Thanks,
Venkat.

Max Berger wrote:
Dear Venkat,

in PDF, we actually try not to do the conversion of color spaces, but
rather (if possible), keep the original color space.

PDF has the possibility to add color space for images, and if a color
space was defined in the original image, AND the image loader was able
to keep the information, the image is written into the PDF with the
color space info attached.

AFAIK, the only image readers able to handle color space correctly are
PNG and JPEG. All other image readers default to RGB.

With JPEG, the image is kept in a "raw" format, and embedded into the
pdf as-is, without even decoding it fully.

Max

2010/2/15 Venkat Reddy <vanukuri.ven...@googlemail.com>:
Hi,

I am still looking for the response from the fop-dev team regarding the
attached mail.
Thanks for your replies in advance.

Venkat.

Hi,

Can anyone know the classes and methods deals with the CMYK colored Images
for PDF Renderer?

I want to know, where exactly the conversion taking palce between RGB and
CMYK color spaces.
I have already worked with AFP and PS renderers for CMYK colored images,
these renderers will use ImageEncodingHelper (XMLGraphicsCommons class) to
render the respective
document with colored images. I thought the same class (ImageEncodingHelper)
is not being used for PDF Renderer.

Can someone give me an idea? where this coversion is taking place?

Thanks,
Venkat.







Jeremias Maerki



Reply via email to