I have used to the below code search the text from pdf and we are unable to get a result for a text which contains “$” symbol. Can you help us on that.
TextSearchOptions op1 = new TextSearchOptions(true);
op1.UseFontEngineEncoding = true;
op1.IgnoreResourceFontErrors = true;
op1.SearchForTextRelatedGraphics = false;
op1.IgnoreShadowText = true;
string searchText = searchString.Replace(" “, @”\s*“).Replace(”\n", @“\s*”);
//searchText = searchText.Replace(“(”, @“(”).Replace(“)”, @“)”);
//searchText = searchText.Replace(“[”, @“[”).Replace(“]”, @“]”);
//searchText = searchText.Replace(“?”, @“?”).Replace(“+”, @“+”);
searchText = searchText.Replace(“$”, @“”);
// searchText = searchText.Replace(“-”, @“-”).Replace(“^”, @“^”);
// searchText = searchText.Replace(“{”, @“{”).Replace(“}”, @“}”);
//searchText = searchText.Replace(“|”, @“|”).Replace(“*”, @“*”);
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(searchText, op1);
document.Pages[1].Accept(textFragmentAbsorber);