EDIT
The pdf files I have been using apparently are on "indesign" format (whatever that means) and therefore have no colour profile, does anyone knows how can I add the profile myself if is possible at all?
End of edit
thanks in advance for any hand that any one can lend on this problem.
First of all let me tell you that I am kind of new at developing for IOS, I am trying to make a pdf reader using quartz on xcode, everything works fine except for the rendering of the images, for some reason the color space is completely messed up. please take a look at this example.
This is the image that I am getting on my IOS device:
And this is how it suppose to look:
as a reference the part of the code that is drawing the pdf page is the following:
- (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context
{
ReaderContentPage *readerContentPage = self; // Retain self
CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White
CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // Fill
CGContextTranslateCTM(context, 0.0f, self.bounds.size.height); CGContextScaleCTM(context, 1.0f, -1.0f);
CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(_PDFPageRef, kCGPDFCropBox, self.bounds, 0, true));
//CGContextSetRenderingIntent(context, kCGRenderingIntentDefault); CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
CGContextDrawPDFPage(context, _PDFPageRef); // Render the PDF page into the context
if (readerContentPage != nil) readerContentPage = nil; // Release self
}
Please if anyone could help me with this problem.
David