Annotation (notes, comments) using Quartz 2d in ios

会有一股神秘感。 提交于 2019-12-07 19:12:11

问题


I am doing PDF based application for iPad. It supports thumbnail view, Free hand comment, And annotations (Notes). Ya and I searched lot on net but I didnt find any relevant answer for making annotation on PDF using Quartz 2d.

We can get PDF page info using
CGPDFDictionaryRef CGPDFPageGetDictionary ( CGPDFPageRef page );
And using Annots key.
bool CGPDFDictionaryGetArray ( CGPDFDictionaryRef dict, "Annots", CGPDFArrayRef *value );
you can get annotation for particular page. If I am right what is key for Notes and if it is there how to update page dictionary.
If i am wrong at all in above concern please let me know how Notes gets rendered on PDF. Or where PDF renderer gets info about Notes.?
Please let me know If any one knows ASAP. Really thanks in advance.


回答1:


I'm currently implementing annotations my framework. Apple doesn't evaluate the "Annots" dictionary AT ALL - so you're on your own.

I basically re-implemented all popular annotation types, how they are drawn, and wrote my own parser that creates the objects out of the Annots dictionary of each CGPDFPage. Then you draw them after you let QuartzCore draw the default pdf page.

To get all keys (Notes, and much more), check out Adobe's PDF Reference. It's quite a read (>1000 pages).

I'm not allowed to name the framework I am working on, so click on my profile instead to see the link.



来源:https://stackoverflow.com/questions/11505782/annotation-notes-comments-using-quartz-2d-in-ios

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