0

I'm currently working on windows application that is loading electoral roll pdf file. What I'm trying to do is to get the data as per Sr. No., Epic No., Name, Father's / Husbands Name, Age, Sex, House No. and pincode.

Data is available in 3 columns and 10 rows i.e. 30 persons details per page (Some pages may have less).

  • VB.Net 2010
  • .Net 4.5 Framework
  • Acrobat Reader DC
  • OS: Windows 7

This is what I found from one of the site but doesn't work

Dim pdfFile As String = TextBox1.Text 
Dim PDFrdr As New PdfReader(pdfFile) 
Dim PDFfld As Object 
For Each PDFfld In PDFrdr.AcroFields.Fields 
 If TextBox3.Text = "" Then 
  TextBox3.Text = PDFfld.key.ToString() 
 Else 
  TextBox3.Text = TextBox3.Text & Environment.NewLine & PDFfld.key.ToString() 
 End If 
Next
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • 2
    Show us what you've tried so far, and explain where you're stuck and where you need our help – marc_s Dec 10 '15 at 07:50
  • This is what i found from one of the site but doesnt work Dim pdfFile As String = TextBox1.Text Dim PDFrdr As New PdfReader(pdfFile) Dim PDFfld As Object For Each PDFfld In PDFrdr.AcroFields.Fields If TextBox3.Text = "" Then TextBox3.Text = PDFfld.key.ToString() Else TextBox3.Text = TextBox3.Text & Environment.NewLine & PDFfld.key.ToString() End If Next – Atish Dukle Dec 10 '15 at 09:13
  • 2
    PDF is a horrible format to read from. I would suggest seeing if you can get the data in a better format. Failing that you may need a 3rd party library to read the data, like iTextSharp. – Sam Makin Dec 10 '15 at 09:57
  • Please **do not** put code samples or sample data into comments - since you cannot format it, it's **extremely hard** to read it.... Instead: **update** your question by editing it to provide that additional information! Thank you. – marc_s Dec 10 '15 at 10:02
  • I have just started with the application and i dont know how to retrive data from electoral roll pdf. In this application user will provide location of electoral roll pdf and application should retrive the data as per Sr. No., Epic No., Name, Father's / Husbands Name, Age, Sex, House No. and pincode in database table. – Atish Dukle Dec 10 '15 at 10:31
  • In this electoral roll pdf the data boxes will have same pattern like Sr. No. at top left corner, besides it is epic no.,next line name and so on. Is there any way to use 3rd party OCR software dll and make it identify boxes, text, fields etc. If anyone knows the coding or how to do it please help. Thank You – Atish Dukle Dec 11 '15 at 04:01

0 Answers0