我正在使用ITextSharp遍历PDF文件。我找不到嵌入表格中的文字。
public bool ReadPdfFileSpecial(string fileName )
{
var found = false;
if (File.Exists(fileName))
{
PdfReader pdfReader = new PdfReader(fileName);
for (int page = 1; page <= pdfReader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
string currentPageText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy);
if (currentPageText.Contains("is over 18 years old. Children must be less than 19 years old to qualify for MediKids. However, "))
found = true; ;
}
pdfReader.Close();
}
return found;
}