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

后端 未结 3 512
情深已故
情深已故 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:51

    This code is having some bugs that can be easily fixable. Well presented Objective C code.

    https://github.com/KurtCode/PDFKitten

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-13 17:04

    Take a look at the CGPDFScanner type; it can be used to parse through a PDF document for strings and particular PDF operators.

    0 讨论(0)
提交回复
热议问题