16,550
社区成员
发帖
与我相关
我的任务
分享
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