问题描述
编辑我一直在使用的pdf文件显然是"indesign"格式(无论如何),因此没有颜色配置文件,有人知道如何在可能的情况下自己添加配置文件?编辑结束
EDITThe 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.
首先,我要告诉您,我是IOS开发的新手,我正在尝试使用在xcode上使用石英的pdf阅读器,除图像渲染(由于某种原因,颜色)之外,其他一切都正常空间完全被弄乱了.请看这个例子.
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.
这是我在IOS设备上获得的图像:
This is the image that I am getting on my IOS device:
这就是它的外观:
作为参考,绘制pdf页面的部分代码如下:
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.
大卫
推荐答案
如我的问题所述,该问题是由于pdf源文件上的色彩空间不足所致,在此应用程序的android版本上,我使用的是很好的库调用MUPDF,它也可用于ios,但不幸的是,对于我来说,此版本比使用石英框架要慢.
As noted on my question the problem is caused by the lack of colour space on the pdf source file, on the android version of this application I am using a very good library call MUPDF that is also available for ios but unfortunately in my case the this version is slower than using the quartz framework.
为此,我必须使用rbg或cmyk颜色空间导出pdf源.
As for this I had to export the pdf source using either rbg or cmyk colour space.
如果但是有人知道如何在应用程序中添加色彩空间,我将很高兴知道它
If However someone knows how to add the colour space within the application I would be very happy to know it
这篇关于pdf图像颜色空间问题ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!