2011-04-03 68 views
2

我对iOS开发有点新,并且对iOS和PDF有一个相当普遍的问题。我知道在iOS4 +中内置PDF支持,但是可以打开PDF查看,然后可以对其进行记录并再次保存?适用于iOS的PDF实用程序

我确定有一些选项可以打开PDF作为背景,并在其上面有一个“可写”覆盖图,将其保存为图像,然后将其作为PDF写出,但我想知道是否有更多“固有”的方式来做到这一点。

谢谢。

回答

0

搜索,看到这样的回答:Text searching PDF

对于覆盖,你可以画出PDF youself,并添加你自己的叠加:

UIGraphicsBeginImageContextWithOptions(pageRect.size, NO, 0.0); 
    CGContextRef context = UIGraphicsGetCurrentContext(); 

    CGContextSaveGState(context); 
    // Flip the context so that the PDF page is rendered 
    // right side up. 
    CGContextTranslateCTM(context, 0.0, pageRect.size.height); 
    CGContextScaleCTM(context, 1.0, -1.0); 

    // Scale the context so that the PDF page is rendered 
    // at the correct size for the zoom level. 
    CGContextScaleCTM(context, pdfScale, pdfScale); 
    CGContextTranslateCTM(context, -pageRect.origin.x, -pageRect.origin.y); 
    CGContextDrawPDFPage(context, pdfPage); 
    CGContextRestoreGState(context); 

    // callback for custom overlay drawing (example_ 
    if ([document shouldDrawOverlayRectForSize:size]) { 
     [document drawOverlayRect:pageRect inContext:context forPage:page zoomScale:1.0 size:size];  
    } 

更新:刚一说明,PDF可以包含旋转信息,因此实际绘图应该读取该元数据并相应地转换上下文。

1

我正在处理同一问题。我开始看FastPDFKit http://mobfarm.eu/fastpdfkit ...你应该能够添加书签,查看大纲,执行搜索和突出显示。我试图看看是否可以覆盖图像,图形和文本元素等一系列内容。然后,我需要将pdf与添加项合并。

我认为我们正在尝试做同样的事情。

+0

嘿!我只需要搜索和突出显示功能。这是否有很好的教程? – 2011-05-17 14:56:45

+0

你好,我们可以谈谈搜索和突出你有机会了解它的一些事情吗? – 2014-11-13 10:55:18

相关问题