瘋狂
STANDING ON THE SHOULDERS OF GIANTS
posts - 481, comments - 486, trackbacks - 0, articles - 1
BlogJava
::
首頁
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
使用apache pdfbox讀取pdf 實例
Posted on 2011-02-24 14:55
瘋狂
閱讀(2787)
評論(2)
編輯
收藏
所屬分類:
java
、
apache項目
public
static
void
main(String[] args)
throws
Exception
{
InputStream inputStream
=
new
BufferedInputStream(
new
FileInputStream(
new
File(
"
d:\\work\\lt.pdf
"
)));
PDDocument pdfDocument
=
PDDocument.load(inputStream);
StringWriter writer
=
new
StringWriter();
PDFTextStripper stripper
=
new
PDFTextStripper();
stripper.writeText(pdfDocument, writer);
String contents
=
writer.getBuffer().toString();
System.out.println(
"
文檔內(nèi)容:
"
+
contents);
PDDocumentInformation documentInformation
=
pdfDocument.getDocumentInformation();
System.out.println(
"
標(biāo)題:
"
+
documentInformation.getTitle());
}
}
需要jar包:
pdfbox-1.4.0.jar
fontbox-1.4.0.jar
評論
#
re: 使用apache pdfbox讀取pdf 實例[未登錄]
回復(fù)
更多評論
2011-04-21 05:16 by
water
利用本程序解決了我的問題。謝謝!
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
JAVA Thread Dump 分析綜述
關(guān)于java RMI在多網(wǎng)卡下(或者啟動360,百度,騰訊等wifi共享下)無法連接問題(java.rmi.ConnectException: Connection refused to host: xx)
Quartz+Spring的集群配置(轉(zhuǎn))
java.awt.headless=true
dom4j通過xpath查詢xml (轉(zhuǎn))
深入探討 Java 類加載器
Java ClassLoader基礎(chǔ)知識
synchronized 要注意的地方
關(guān)于java.lang.IllegalMonitorStateException
ThreadPoolExecutor運轉(zhuǎn)機制詳解 .
Powered by:
BlogJava
Copyright © 瘋狂
日歷
<
2011年2月
>
日
一
二
三
四
五
六
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
1
2
3
4
5
6
7
8
9
10
11
12
公告
公眾號:
QQjava交流群:
51374316
留言簿
(11)
給我留言
查看公開留言
查看私人留言
隨筆分類
all 生活雜談(16)
android(18)
apache項目(20)
chart(1)
concurrent(5)
database(70)
dwr(3)
flex(6)
hibernate(25)
java (135)
javafx(2)
javascript
java安全(8)
java性能(19)
jbpm(1)
jquery(4)
linux(17)
lucene(1)
netty(3)
nginx(1)
others(2)
questions(31)
questions_hander(28)
spring(32)
struts(9)
swing
UML(2)
unix(13)
web(45)
webservice(9)
xml(5)
敏捷(6)
方法論(28)
架構(gòu)(21)
測試(1)
緩存
網(wǎng)絡(luò)通訊(9)
讀代碼(6)
項目管理(19)
相冊
我的相冊
搜索
積分與排名
積分 - 2842746
排名 - 2
最新隨筆
1.? 后續(xù)內(nèi)容請移步公眾號“duomi88”
2.?Netty百萬級推送服務(wù)(轉(zhuǎn))
3.?Netty 概述(轉(zhuǎn))
4.?Netty優(yōu)雅退出機制和原理(轉(zhuǎn))
5.?使用JavaMail SearchTerm 收取郵件
6.?JAVA Thread Dump 分析綜述
7.?oracle 索引字段包含date類型,使用spring jdbc更新時不走索引,而是走table access full的問題
8.?FTP主動模式和被動模式的比較(轉(zhuǎn)載)
9.?關(guān)于java RMI在多網(wǎng)卡下(或者啟動360,百度,騰訊等wifi共享下)無法連接問題(java.rmi.ConnectException: Connection refused to host: xx)
10.?(轉(zhuǎn))Oracle數(shù)據(jù)庫如何授權(quán)收費(Database Licensing)
11.? 成功的 Web 應(yīng)用系統(tǒng)性能測試 (轉(zhuǎn)載)
12.?It is indirectly referenced from required .class file異常
13.?(轉(zhuǎn))svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
14.?automation服務(wù)器不能創(chuàng)建對象 解決辦法
15.?ERROR: transport error 202: gethostbyname: unknown host 解決辦法
16.?JavaScript 跨瀏覽器事件處理(轉(zhuǎn))
17.?函數(shù)聲明 VS 函數(shù)表達(dá)式(轉(zhuǎn))
18.?ORA-06548錯誤
19.?項目規(guī)劃與管理記錄2
20.?tmpFile.renameTo(classFile) failed
21.?redhat6.4 64位安裝rlwrap
22.?ora-01031:insufficient privileges
23.?mysql遠(yuǎn)程連接問題 Access denied for user 'root'@' ip ' (using password: YES)
24.?dbcp重連(轉(zhuǎn))
25.?解決Vmware Workstation上安裝Linux系統(tǒng)不能SSH遠(yuǎn)程連接的問題
26.?URL最大長度限制(轉(zhuǎn))
27.?用MyEclipse測試發(fā)送email時報java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
28.?我應(yīng)該采用哪一種 WSDL 樣式?(轉(zhuǎn)載)
29.?linux 掛載ntfs usb 出現(xiàn)mount: unknown filesystem type 'ntfs'
30.?11g oracle 用戶密碼過期問題
最新評論
1.?re: Oracle物化視圖創(chuàng)建全過程(轉(zhuǎn))
評論內(nèi)容較長,點擊標(biāo)題查看
--ya
2.?re: Oracle物化視圖創(chuàng)建全過程(轉(zhuǎn))
評論內(nèi)容較長,點擊標(biāo)題查看
--ya
3.?re: 11g oracle 用戶密碼過期問題
問問
--是是是
4.?re: mysql遠(yuǎn)程連接問題 Access denied for user 'root'@' ip ' (using password: YES)
asdfsadf
--asdf
5.?re: struts(il8n)實現(xiàn)國際化的一個例子
在啥地方
--正常
主站蜘蛛池模板:
金门县
|
海阳市
|
改则县
|
隆昌县
|
郴州市
|
呼玛县
|
洪江市
|
杭锦旗
|
柳州市
|
美姑县
|
平顺县
|
长治县
|
调兵山市
|
罗定市
|
湖南省
|
贵州省
|
陆河县
|
彰化县
|
正宁县
|
广宁县
|
南昌市
|
花莲县
|
博罗县
|
宁化县
|
西盟
|
湘乡市
|
赞皇县
|
昭觉县
|
黑龙江省
|
曲水县
|
平山县
|
宜丰县
|
自贡市
|
嵊州市
|
韶关市
|
金堂县
|
德江县
|
甘德县
|
工布江达县
|
原平市
|
扎兰屯市
|