问题
I am using PDFSharp. I need help. I need to check wether the document contains the word "abc". Example:
11abcee = true
444abcggw = true
778ab = false
I wrote this code, but it does not work as expected:
PdfDocument document = PdfReader.Open("c:\\abc.pdf");
PdfDictionary dictionary = new PdfDictionary(document);
string a = dictionary.Elements.GetString("MTZ");
if (a.Equals("MTZ"))
{
MessageBox.Show("OK", "");
}
else
{
MessageBox.Show("NO", "");
}
Am I missing something?
回答1:
maybe this SO entry will help you: PDFSharp alter Text repositioning. It links to here - text extraction example with PDFSharp.
来源:https://stackoverflow.com/questions/16361730/find-a-word-in-pdf-using-pdfsharp