如何将pdf数据转换为Excel [英] How to convert pdf data to Excel
本文介绍了如何将pdf数据转换为Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我正在使用vs2010,itextsharp.我需要将pdf数据转换为Excel.我的pdf包含表格数据.所以我想要将数据与pdf转换为Excel..帮帮我.
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.
推荐答案
请参阅类似的已解决质量检查: ^ ]
Refer similar solved QA: PDF table data to Excel using Vb.net[^]
http: //bytescout.com/products/developer/pdfextractorsdk/extract-from-pdf-to-excel-csv-in-csharp [ http://bytescout.com/products/developer/pdfextractorsdk/convert-pdf-to- excel-csv [ ^ ]
http://bytescout.com/products/developer/pdfextractorsdk/extract-from-pdf-to-excel-csv-in-csharp[^]
http://bytescout.com/products/developer/pdfextractorsdk/convert-pdf-to-excel-csv[^]
尝试从PDF文件提取文本的代码:
Try code I use to extract text from PDF file:
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()
加载文本文件并将数据保存到excel文件.
Load the text file and save data to excel file.
这篇关于如何将pdf数据转换为Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文