Hii friends, i am developing a e Book using a web view where i am loading the web view with PDF document.Now i want to develop the search functionality but i am not unserstanding how to implement it.So kindly give me a solution,
Thanks in advance.
Hii friends, i am developing a e Book using a web view where i am loading the web view with PDF document.Now i want to develop the search functionality but i am not unserstanding how to implement it.So kindly give me a solution,
Thanks in advance.
Instead of using UIWebView
, you might want to look into using Quartz 2D's CGPDFDocumentRef
and parsing a CGPDFDictionary
for strings of interest.
Once your know which PDF dictionary elements contain your text and where they are located, you might be able to highlight that text with other Quartz 2D routines.
Another option might be to convert your PDF document to RTF or HTML formats, either of which would probably be easier to parse and edit to add highlighting.
hey alex thanks for the help,But i have never used CGPDFDocumentRef and CGPDFDictionary.So if you can give me some example or the tutorial on how to use this two,it would be of great help,Thanks a lot for this reply,
also u said to convert the PDF file into html or rtf file which is difficult to do because for that i need to get the PDF contents into the string.I am copying the PDF contents into string but it is giving junk values,
it seems not an easy work, here is my thought.
Instead of using CGContextDrawPDFPage in Quartz2D, you may need to layout the page yourself for getting the CGRect of the text for highlight.