How to search text in pdf document with quartz

吃可爱长大的小学妹 提交于 2019-12-02 21:28:03

Use CGPDFDocument, CGPDFPage and CGPDFScanner to scan and parse the contents of the page into NSString. Then use NSString function to find the text on that page. If it exists store the corresponding pagenumber in some array. Repeat this scanning and parsing in for loop for number of pages in the pdf

http://www.random-ideas.net/posts/42%22

check out the above link its working.

There's nothing to do this inside of Quartz. Quartz is for graphics display - it doesn't need to know, or care about, searching a PDF for string matches. You will have to use the Core Graphics PDF parsing methods to pull out the data, search for the string yourself, and then get the page it occurs on.

If you use PDFDocument, instead of CGPDFDocument, that API has text search operations, such as findString:withOptions

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