Reading Information from a PDF File
Morning EveryoneI need help to read information from a PDF file.
The PDF file has table there fore I would like to read the info per field.
This is what I used
public string ReadPdfFile(string fileName)
{
StringBuilder text = new StringBuilder();
if (File.Exists(fileName))
{
PdfReader pdfReader = new PdfReader(fileName);
for (int page = 1; page <= pdfReader.NumberOfPages; page++)
{
//itex
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
//string strttt = pdfReader.AcroFields.Fields.
string currentText = PdfTextExtractor.GetTextFromPage(pdfReader, page, strategy);
currentText = Encoding.UTF8.GetString(ASCIIEncoding.Convert(Encoding.Default, Encoding.UTF8, Encoding.Default.GetBytes(currentText)));
text.Append( currentText);
}
pdfReader.Close();
}
return text.ToString();
}
This code is read reading it per page therefore I still have to rearrange data. Can I read it per field please help.
Thanx in advance