[reportlab-users] How can I insert CMYK JPG in CMYK pdf document ?

KLEIN Stéphane stephane at harobed.org
Mon Jul 20 08:33:07 EDT 2009


Hi,

I produce CMYK PDF document and I need to insert CMYK JPG file in my
document.

I've one simple example :


::


from reportlab.pdfgen import canvas
from reportlab.lib.units import cm, mm
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen.pdfimages import PDFImage

c = canvas.Canvas( "test.pdf", pagesize = A4)
c.drawString(200, 100, "hello.pdf")

img = PDFImage("image_test_cmjn.jpg", 100, 500, 300, 300)
img.drawInlineImage(c, preserveAspectRatio = True)

c.showPage()
c.save()

"image_test_cmjn.jpg" is a CMYK image.
When I look test.pdf, this image appear converted in RGB.

How can I fix this issue ?

Do you have one example ?

Thanks for your help,
Stephane



More information about the reportlab-users mailing list