EDIT我一直在使用的pdf文件显然是“indesign”格式(无论这意味着什么),因此没有颜色配置文件,有谁知道如果可能的话我如何自己添加配置文件?编辑结束
预先感谢任何人可以为解决此问题提供帮助。
首先让我告诉你,我在 IOS 开发方面是个新手,我正在尝试使用 xcode 上的quartz 制作一个 pdf 阅读器,除了图像的渲染之外,一切都正常,由于某种原因,颜色空间完全是弄乱。请看一下这个例子。
这是我在 IOS 设备上获取的图像:
这就是它应该看起来的样子:
作为参考,绘制 pdf 页面的代码部分如下:
- (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
}
如果有人可以帮助我解决这个问题,请。
David