0

I am trying to do search functionality in iPhone. I pass the page number and the string to be searched.. but it is not getting the proper output. in contentStream I get nothing. I got this code by googling. I don't know what will be there in contentStream object.

-(BOOL)page:(CGPDFPageRef)inPage containsString:(NSString *)inSearchString {
[self setCurrentData:[NSMutableString string]];
CGPDFContentStreamRef contentStream = CGPDFContentStreamCreateWithPage(inPage);
CGPDFScannerRef scanner = CGPDFScannerCreate(contentStream, table, self);
bool ret = CGPDFScannerScan(scanner);
CGPDFScannerRelease(scanner);
CGPDFContentStreamRelease(contentStream);
return ([[currentData uppercaseString] 
         rangeOfString:[inSearchString uppercaseString]].location != NSNotFound);

}

If there is any other solution then also it is fine.

BenMorel
  • 31,815
  • 47
  • 169
  • 296
Jaimin
  • 791
  • 2
  • 11
  • 27

2 Answers2

2

YOU SHOULD IMPLEMENT THE COMPLETE CODE

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

check out the above link a complete code to do so.

profile for Fasttracks at Stack Overflow, Q&A for professional and enthusiast programmers

Community
  • 1
  • 1
GameLoading
  • 6,630
  • 2
  • 32
  • 57
0

Check out this question and its answers for more information: PDF search on the iPhone

Community
  • 1
  • 1
ySgPjx
  • 9,953
  • 7
  • 57
  • 77