我试图使用CGPDFDocument编写一个基于QuartzDemo的简单PDF查看器。
有常见的渲染:
-(void)drawInContext:(CGContextRef)context
{
// PDF page drawing expects a Lower-Left coordinate system,
// so we flip the coordinate system before we start drawing.
CGContextTranslateCTM(context, 0.0, self.bounds.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
// Grab the first PDF page
CGPDFPageRef page = CGPDFDocumentGetPage(pdf, pageNumber);
// We're about to modify the context CTM to draw the PDF page
// where we want it, so save the graphics state
// in case we want to do more drawing
CGContextSaveGState(context);
// CGPDFPageGetDrawingTransform provides an easy way
// to get the transform for a PDF page. It will scale down to fit,
// including any base rotations necessary to display the PDF page correctly.
CGAffineTransform pdfTransform =
CGPDFPageGetDrawingTransform(page,
kCGPDFCropBox, self.bounds, 0, true);
// And apply the transform.
CGContextConcatCTM(context, pdfTransform);
// Finally, we draw the page
// and restore the graphics state for further manipulations!
CGContextDrawPDFPage(context, page);
CGContextRestoreGState(context);
}据我所知,它的唯一绘图,所以所有的结构导航或传出链接应该手动处理(例如。接触事件)。
有它将设置URL或用URL创建元素函数。
问题是:如何从特定的PDF块获取传出链接URL?
谢谢!
类似的问题:
同上
iPhone SDK开发GGroup
macRumors论坛
iPhone开发SDK论坛
发展和发展论坛
iphonedevbook.com
发布于 2010-09-28 00:27:05
这是一个很重要的问题,这就是为什么你没有找到简单的答案。解决方案是:您必须解析PDF文档。好消息是,苹果公司提供了一些功能,可以让你做到这一点。坏消息是,它们是程序性的,人类,这是一个复杂的混乱。
在非常粗略的伪代码中:
Adobe已经发布了一个文档,它展示了PDF规范。祝好运!
https://stackoverflow.com/questions/3257057
复制相似问题