Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to read particular values from pdf file using asp.net c#, like date, Name , email id etc.

Please help.
Thanks

What I have tried:

I tried some code from google but it is for reading all values, but i want some particular values.

static void Main(string[] args)
{

string pdfdata = ExtractTextFromPdf(@"report_grid.pdf");
Console.WriteLine(pdfdata);
System.Console.ReadLine();
}
public static string ExtractTextFromPdf(string path)
{
using (PdfReader reader = new PdfReader(path))
{
StringBuilder text = new StringBuilder();

for (int i = 1; i <= reader.NumberOfPages; i++)
{
text.Append(PdfTextExtractor.GetTextFromPage(reader, i));
}

return text.ToString();
}
}
Posted
Updated 23-Jan-17 19:44pm
v5
Comments
OriginalGriff 19-Jan-17 2:18am    
Do you mean a PDF file? If not, what do you mean? "pfd" means nothing to me...
And show what you tried, explain exactly where you are stuck. It may help us understand your problem and that can only improve the answers you get.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

Quote:
I tried some code from google but it is for reading all values, but i want some particular values
I suppose it should be a two-steps approach:
  • retrieve all the text
  • extract the meaningful information from such text
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900