Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I'm using vs2010,itextsharp. I need to convert my pdf datas to Excel. my pdf contains table wise datas. so i want the datas in same view as pdf to Excel.. Help me anyone.
Posted

Refer similar solved QA: PDF table data to Excel using Vb.net[^]
 
Share this answer
 
Try code I use to extract text from PDF file:
VB
Dim mPDF as string="C:\test.pdf"
Dim mTXT as string="C:\test.txt"
Dim mPDFreader As New iTextSharp.text.pdf.PdfReader(mPDF)
Dim mPageCount as integer  = mPDFreader.NumberOfPages()

 'Create the text file.
 Dim fs As FileStream = File.Create(mTXT)
 Dim strategy As iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy
            For i As Integer = 1 To mPageCount
                strategy = parser.ProcessContent(i, New iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy())
                Dim info As Byte() = New UTF8Encoding(True).GetBytes(strategy.GetResultantText())
                fs.Write(info, 0, info.Length)
            Next
 fs.Close()


Load the text file and save data to excel file.
 
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