Add pdf annotation with PDF Kit in OS 10.12

半腔热情 提交于 2019-12-01 08:42:20

问题


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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/39784953/add-pdf-annotation-with-pdf-kit-in-os-10-12

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!