How to search text in pdf document with quartz

前端 未结 4 1261
清酒与你
清酒与你 2021-02-03 16:01

I\'m using quartz to display pdf. I need to get the indexes of pages where my searching text exists. Anyone can help me? Thanks.

Solution: There is a sa

4条回答
  •  [愿得一人]
    2021-02-03 16:51

    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

提交回复
热议问题