VB.NET 如何读取PDF文件

lwl0606 2008-10-15 04:51:51
VB.NET 如何读取PDF文件?并得到页码信息,如第几页的内容是什么?
Adobe Reader里面有没有相应的组件?
...全文
1208 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
lwl0606 2008-10-17
  • 打赏
  • 举报
回复
谢谢,就是dll文件太大了
fairy4 2008-10-16
  • 打赏
  • 举报
回复
http://topic.csdn.net/u/20080920/11/f5141ce4-8daf-473e-b54e-b65047f5e990.html
转换成vb.net为:

Imports System
Imports org.pdfbox.pdmodel
Imports org.pdfbox.util
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' string pdfPath = Server.MapPath("index.pdf");
'PDDocument doc = PDDocument.load(pdfPath);
'PDFTextStripper stripper = new PDFTextStripper();
'string txt = stripper.getText(doc);
Dim pdfPath As String = Application.StartupPath & "\a.pdf"
Dim doc As PDDocument = PDDocument.load(pdfPath)
Dim stripper As PDFTextStripper = New PDFTextStripper
Dim txt As String = stripper.getText(doc)
Me.RichTextBox1.Text = txt & "读取完成"

End Sub
End Class
gytzExcel 2008-10-16
  • 打赏
  • 举报
回复
lw10606
有没有将excel转换成pdf的好方法
请教一下!
lwl0606 2008-10-16
  • 打赏
  • 举报
回复
有没有更具体点的、
一只熊猫 2008-10-16
  • 打赏
  • 举报
回复
嗯,要装adobe reader,然后引用相关的组件。。
chndnk 2008-10-16
  • 打赏
  • 举报
回复
路过,顺便学习了
IWAWWFY 2008-10-15
  • 打赏
  • 举报
回复
装了adobe reader com里就有组件可以用。
Forrest23 2008-10-15
  • 打赏
  • 举报
回复
错了,应该添加Adobe Acrobat 8.0 Type Library的引用
wangyanboq 2008-10-15
  • 打赏
  • 举报
回复
pdf格式不太了解,相信你的意思应该是读取pdf中的类似txt的文件内容。

pdf肯定有自己的编码方式,可以找找是否有开源的组件,实现pdf内容的解码。或许adobe已经提供了
Forrest23 2008-10-15
  • 打赏
  • 举报
回复
装了pdf阅读器,添加Adobe Acrobat 8.0 Browser Control Type Library 1.0引用

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧