PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 18, 2021 2:23 pm

All times are UTC

Forum rules

Please read this before posting on this forum: Forum Rules

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CMYK Images
PostPosted: Fri Nov 03, 2006 7:50 pm 

Joined: Fri Nov 03, 2006 3:49 pm
Posts: 1
Hi there,

It seems that when you add a JPEG which uses a CMYK colorspace, the image is not rendered correctly.

Is there a way around this?


Reply with quote  
 Post subject:
PostPosted: Fri Nov 03, 2006 10:24 pm 
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
The problem is that GDI+ does not report that the image is CMYK. You must modify the function PdfImage.InitializeJpeg:
Elements[Keys.ColorSpace] = new PdfName("/DeviceCMYK");

Depending on the image you may also change the decoding:
Elements["/Decode"] = new PdfLiteral("[1 0 1 0 1 0 1 0]");

The problem is that this information cannot be retrieved with GDI+ (or at least I don’t know how).

I suggest you to make a hack: Introduce flags in the XImage class that you can use to decide when you must change the colorspace and decode params.

Stefan Lange

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Google [Bot] and 17 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group