在OS 10.12中使用PDF Kit添加pdf注释 [英] Add pdf annotation with PDF Kit in OS 10.12

查看:191
本文介绍了在OS 10.12中使用PDF Kit添加pdf注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在是最新的os10.12操作系统,可以显示PDF批注,但是现在我仍然有问题,我在PDFView-> mouseDragged之前记录了坐标信息,然后会自动调用PDFView-> drawPage函数,这函数,我将绘制NSBezierPath曲线以确定动态注释范围.但是现在在mouseDragged的过程中尚未调用drawPage:toContext函数.所以我看不到添加注释的动态曲线.我使用的刷新方法仍然不调用drawPage:toContext,只有打开pdf和滚动视图pdf套件才会调用drawPage:toContext.我想知道如何调用此函数.非常感谢您的帮助.

Now the latest os10.12 operating system, PDF annotation can be displayed, but now I still have a problem, I recorded coordinate information in PDFView ->mouseDragged before, and then automatically will invoke the PDFView->drawPage function, this function I will draw the NSBezierPath curve to determine the dynamic annotation bounds. but now in the process of mouseDragged has not been call the drawPage:toContext function. So I can't see the dynamic curve of adding annotation. I use the refresh method is still not invoke drawPage:toContext, only open pdf and scroll view pdf kit will invoke drawPage:toContext. I would like to know how to call this function. Thank you very much for your help.

推荐答案

PDFKit暂时被视为泡菜. https://forums.developer.apple.com/thread/60440

PDFKit sems to be in bit of a pickle at the moment. https://forums.developer.apple.com/thread/60440

我使用drawPage:inContext :(这是drawPage:toContext:涵盖的私有方法)取得了一些成功.尝试将drawPage:inContext:添加到类扩展中(ARC需要定义所有选择器),然后查看是否被调用.

I have had some success using drawPage:inContext: (which is a private method covered by drawPage:toContext:). Try adding drawPage:inContext: to a class extension (ARC requires all selectors to be defined) and see if it gets called.

这篇关于在OS 10.12中使用PDF Kit添加pdf注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆