Is there any PDF parser written in objective-c or c?

后端 未结 3 511
情深已故
情深已故 2021-01-13 16:46

I\'m writing a pdf reader iPhone application.

I know how to show pdf file in view using CGPDF** classes in iOS.

What I want to do now is to search text in pd

3条回答
  •  伪装坚强ぢ
    2021-01-13 16:58

    CGPDFScanner can only scan the pdf contents but there is no way you can find the location of the word in the pdf. So highlighting is not possible using cgpdf functions. Also the scanner output is encoded text for flateDecoded and other types of pdf. It can only scan simple pdfs i.e Linear pdfs. (Open the pdf as text file and at the top you will find the word Linearized pdf.) Possible solution would be using a c or c+ parsing library if you get one. Also the cpp project from the code project will only parse the content but wont give any location information. Writing a pdf parser on your own is complex because pdf formats are complicated and not fixed. Pdf content can be encoded in different ways like FlateDecode type etc.

提交回复
热议问题