一年多以来,我一直在iPad应用程序中使用多种方法,主要基于苹果代码available here来很好地显示PDF页面-到目前为止,它对数十种不同的PDF都适用。我刚得到一堆看起来有些变形的PDF。预览/ Adob​​e显示的内容:

这就是我使用模拟器在基于图层的CGPDFDrawPDFPage()和iPad UIWebView(指向文件)中看到的内容:

我想知道PDF是否在某种奇怪的色彩空间(CMYK?)中,但这无法解释为什么Preview / Adob​​e Reader可以很好地打开它。作为参考,这是UIView子类中使用的显示代码的总和(请注意,pdfPage是一个实例变量):

// Draw the CGPDFPageRef into the layer at the correct scale.
-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{
    // from https://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints
    CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
    CGContextSetRenderingIntent(context, kCGRenderingIntentDefault);

    // First fill the background with white.
    CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f);
    CGContextFillRect(context, self.bounds);

    CGContextSaveGState(context);
    // Flip the context so that the PDF page is rendered
    // right side up (all the PDF routines are built for Mac OS X
    // coordinate systems, where Y is upwards.

    // first move the origin down by the full height
    CGContextTranslateCTM(context, 0.0f, self.bounds.size.height);
    // now invert the Y position (scale by -1)
    CGContextScaleCTM(context, 1.0f, -1.0f);

    // Scale the context so that the PDF page is rendered
    // at the correct size for the zoom level.
    CGContextScaleCTM(context, myScale, myScale);
    CGContextDrawPDFPage(context, pdfPage);

    CGContextRestoreGState(context);
}

如您所见,我们也是Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints?的狂热读者

关于如何诊断我们所看到的内容和/或更改色彩空间(或更改PDF文档?)的任何建议。

最佳答案

我猜您的PDF除了使用CMYK之外,还会使用一种或多种专色。似乎iOS上不支持这些功能-据我所知,这在任何地方都没有记录,但这是我的经验。

如果您具有Acrobat Pro,则可以使用墨水管理器(高级→打印生产→墨水管理器)进行检查。

您也可以使用Acrobat将专色转换为原色(高级→打印生产→转换颜色...)。单击颜色转换对话框中的“油墨管理器”按钮,然后在其中激活“将所有斑点转换为印刷”复选框。

10-06 12:55