title: Search within PDF Files to Find a String
body: <p>I need to search within a pdf file to find a string.I know that itextsharp has this feature and i can use this code </p>
  
  <pre><code>public bool SearchPdfFile(string fileName, String searchText)
  {
      /* technically speaking this should not happen, since "you" are calling it
         therefore this should be handled critically
          if (!File.Exists(fileName)) return false; //original workflow
      */
      if (!File.Exists(fileName))
          throw new FileNotFoundException("File not found", fileName);
  
      using (PdfReader reader = new PdfReader(fileName))
      {
          var strategy = new SimpleTextExtractionStrategy();
  
          for (int page = 1; page &lt;= pdfReader.NumberOfPages; page++)
          {
              var currentPageText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy);
              if (currentPageText.Contains(searchText))
                  return true;
          }
      }
  
      return false;
  }
  </code></pre>
  
  <p>But im using the itext under LGPL/MPL License (version 3.0/4.0) ,the newer version 5.0 is only free if I make my own software free under the AGPL. The class SimpleTextExtractionStrategy is undefined in this version of itext.Is there any alternative to do this using the old version of itext?</p>