[reportlab-users] cmyk-images

Robin Becker robin at reportlab.com
Fri Apr 8 03:51:43 EDT 2005


manuela kiesenhofer - next gmbh wrote:
> hi, 
> 
> my name is manuela kiesenhofer
> and I am working in an internet agenency in linz, austria. 
> 
> I've tested the reportlab opensource libary
> and I think it's really great!!
> 
> the only problem is that it seems that the libary doesn't support 
> the usage of cmyk-jpgs or cmyk-tifs.
> 
> however, has anybody of you found a way to insert cmyk-images 
> into a pdf generated by reportlab?
> 
> cu, manu
Heile Manuela, this may be my fault as I programmed the image inclusion 
stuff. JPEG is supposed to be a native format for PDF. Looking at the 
code I see

	if info[2] == 1:
		self.colorSpace = 'DeviceGray'
	elif info[2] == 3:
		self.colorSpace = 'DeviceRGB'
	else: #maybe should generate an error, is this right for CMYK?
		self.colorSpace = 'DeviceCMYK'

so we are attempting to do CMYK provided this path is followed. The 
filename needs to have an extension .jpeg or .jpg for this to work.

So 1) are you working from a recent source, 2) are you loading via a 
filename?

If not send me a snippet of code and a sample jpeg and I'll attempt to 
figure out what's wrong.
-- 
Robin Becker


More information about the reportlab-users mailing list