我正在尝试使用基于 QuartzDemo 的 CGPDFDocument编写一个简单的 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/iPad 上的 PDF 超链接
如何访问 PDF 文档 (iPhone) 中的超链接?
同样在
iPhone SDK 开发 GGroup
macRumors 论坛
iPhone 开发 SDK 论坛
Dev Shed 论坛
iphonedevbook.com