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
  • 34,448
  • 50
  • 182
  • 322
Jaimin
  • 801
  • 2
  • 12
  • 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,688
  • 2
  • 33
  • 57
0

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

Community
  • 1
  • 1
ySgPjx
  • 10,165
  • 7
  • 61
  • 78