Mak*_*tar 24 pdf iphone cocoa-touch hyperlink quartz-2d
我想写使用一个简单的PDF查看器CGPDFDocument,基于QuartzDemo.
常见的渲染:
-(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);
}
Run Code Online (Sandbox Code Playgroud)
据我所知,它是唯一的绘图,所以所有结构导航或外出链接都应该手动处理(例如触摸事件).
问题是:如何从某些PDF块获取传出链接URL?
谢谢!
类似问题:
iPhone/iPad上的PDF超链接
如何访问PDF文档(iPhone)中的超链接?
相同的
iPhone SDK Dev GGroup
macRumors论坛
iPhone Dev SDK论坛
Dev Shed论坛
iphonedevbook.com
Ben*_*ieb 17
这是一个非常重要的问题,这就是为什么你找不到简单的答案.解决方案是:您必须解析PDF文档.好消息是,Apple提供的功能允许您这样做.坏消息是,它们是程序性的,男人,这是一个令人费解的混乱.
在非常粗略的伪代码中:
Adobe已发布了一份文档,其中列出了PDF规范.祝好运!
| 归档时间: |
|
| 查看次数: |
7888 次 |
| 最近记录: |