◎筱米加步枪◎.Blog

Happy coding

使用pdfBox读取PDF文件注意问题

筱米加步枪 posted @ 2010年6月13日 04:57 in [ 开源框架 ] with tags pdfbox , 4643 阅读

本来想要iText来读取pdf的,结果网上搜索下得出结论,使用iText读取pdf基本上是无法实现的。

于是还是改用了pdfBox来读取文件。于是造成了iText与pdfBox混用的尴尬。

虽然如此,但也遇到了不少问题。下面分析遇到的问题。
---------------------------------------------------------------------------------

1.首先最好要下载pdfbox 1.1的版本。处理文档方面比较完善,如果是低版本的话,是不支持字体与语言的读取。会报错。

2.另外还要下载fontbox 1.1 的包,这对多种字体以及多种语言的支持。注意版本,不然会报有一些类找不到。

3.还要加入common-loggin的包,不然进行读取的时候会遇到类找不到异常,主要是用到org.apache.commons.logging.LogFactory类

---------------------------------------------------------------------------------

遇到的问题主要是使用的包版本太对,或者两者的版本不匹配造成的。

贴个使用pdfbox来读取pdf文档内容的代码:

/**
	 * 读取指定路径的pdf文件的文本内容<br>
	 * @param filePath  指定路径
	 * @return pdf文件的文本内容
	 * @throws IOException
	 */
	public String readPdf(String filePath) throws IOException{
		File file = new File(filePath);
		FileInputStream fis = new FileInputStream(file);
		//创建一个PDF解析器
		PDFParser parser = new PDFParser(fis);
		//进行解析
		parser.parse();
		//得到PDF文档对象
		PDDocument document = parser.getPDDocument();
		//新建一个PDF文件剥离器
		PDFTextStripper stripper = new PDFTextStripper();
		//从文档对象中剥离文本
		String content = stripper.getText(document);
		fis.close();
		document.close();
		return content;
  • 无匹配
  • 无匹配
Grade 5 Result Sylhe 说:
2022年8月27日 02:20

The Primary School Certificate Examination tests 2022 are successfully completed in November for all education boards across the country all divisions, and they have going to announce PSC Result 2022 Sylhet Board with full mark sheet under DPE along with Sylhet board for the academic terminal examination tests. Grade 5 Result Sylhet Board Based on the DPE announcement there are 30 lacks of students are participated from all divisions across the country for this Primary Education Course (PEC) from all education boards included the Sylhet board, every year those Grade-5 Terminal annual final exams are conducted under the Directorate of Primary Education (DPE) and this year also conducted same without delay.

seo service london 说:
2023年11月01日 00:00

Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon.

로켓도메인 说:
2023年11月21日 19:10

I will understand this. I'll make certain to return. gratitude for sharing. and furthermore This article gives the light in which we can notice the truth. this is extremely decent one and gives indepth data. gratitude for this decent article...

온라인카지노순위 说:
2023年11月21日 19:52

Pretty useful article. I simply stumbled upon your net site and wanted to mention that I’ve very preferred learning your blog posts. Any signifies I’ll be subscribing together with your feed and I wish you put up as soon as extra quickly. sbobet

토크리 说:
2023年11月21日 20:16

Pretty useful article. I simply stumbled upon your net site and wanted to mention that I’ve very preferred learning your blog posts. Any signifies I’ll be subscribing together with your feed and I wish you put up as soon as extra quickly. sbobet

스포츠실시간배팅 说:
2023年11月21日 20:48

I appreciate everything you have added to my knowledge base. Admiring the time and effort you put into your blog and detailed information you offer.

신규가입꽁머니 说:
2023年11月21日 21:01

You have performed a great job on this article.It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much

안전놀이터 说:
2023年11月21日 21:34

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business.

먹튀검증 说:
2023年11月21日 21:43

What i don’t realize is in fact how you’re no longer actually much more smartly-liked than you may be right now. You are very intelligent. You understand thus significantly on the subject of this matter, produced me for my part imagine it from so many various angles. Its like men and women are not involved unless it is something to do with Lady gaga! Your personal stuffs nice. Always maintain it up!

먹튀검증사이트 说:
2023年11月21日 21:49

This is getting a touch more emotional, yet I very much want the Zune Commercial center. The point of interaction is bright, has more style, and a few cool highlights like 'Mixview' that let you rapidly see related collections, tunes, or different clients connected with what you're paying attention to. Tapping on one of those will fixate on that thing, and one more arrangement of "neighbors" will materialize, permitting you to explore around investigating by comparative craftsmen, melodies, or clients. Discussing clients, the Zune "Social" is likewise incredible tomfoolery, allowing you to track down others with imparted preferences and becoming companions to them. You then, at that point, can pay attention to a playlist made in view of a mixture of what every one of your companions are paying attention to, which is likewise charming. Those worried about protection will be feeling quite a bit better to realize you can keep the general population from seeing your own listening propensities in the event that you so decide.

토토사이트 说:
2023年11月21日 21:57

This is getting a touch more emotional, yet I very much want the Zune Commercial center. The point of interaction is bright, has more style, and a few cool highlights like 'Mixview' that let you rapidly see related collections, tunes, or different clients connected with what you're paying attention to. Tapping on one of those will fixate on that thing, and one more arrangement of "neighbors" will materialize, permitting you to explore around investigating by comparative craftsmen, melodies, or clients. Discussing clients, the Zune "Social" is likewise incredible tomfoolery, allowing you to track down others with imparted preferences and becoming companions to them. You then, at that point, can pay attention to a playlist made in view of a mixture of what every one of your companions are paying attention to, which is likewise charming. Those worried about protection will be feeling quite a bit better to realize you can keep the general population from seeing your own listening propensities in the event that you so decide.

토토사이트꽁머니 说:
2023年11月21日 22:11

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates

우리카지노주소 说:
2023年11月21日 22:26

As a result blog, you'll see your bank account, consider towards plod throughout who particulars

먹튀검증커뮤니티추천 说:
2023年11月21日 22:34

As a result blog, you'll see your bank account, consider towards plod throughout who particulars

토토사이트 说:
2023年11月21日 22:41

I will understand this. I'll make certain to return. gratitude for sharing. and furthermore This article gives the light in which we can notice the truth. this is extremely decent one and gives indepth data. gratitude for this decent article...

먹튀검증사이트 说:
2023年11月21日 23:29

Pretty useful article. I simply stumbled upon your net site and wanted to mention that I’ve very preferred learning your blog posts. Any signifies I’ll be subscribing together with your feed and I wish you put up as soon as extra quickly. sbobet

토토사이트추천 说:
2023年11月21日 23:46

Pretty useful article. I simply stumbled upon your net site and wanted to mention that I’ve very preferred learning your blog posts. Any signifies I’ll be subscribing together with your feed and I wish you put up as soon as extra quickly. sbobet

토토매거진 说:
2023年11月21日 23:51

Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though.

안전놀이터 说:
2023年11月22日 00:28

I appreciate everything you have added to my knowledge base. Admiring the time and effort you put into your blog and detailed information you offer.

가족방 说:
2023年11月22日 00:41

That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more

먹튀검증 说:
2023年11月22日 00:48

Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though.

슈어맨주소 说:
2023年11月22日 00:54

I’m delighted that I have noticed this weblog. Lastly something not a junk, which we undergo incredibly frequently. The web site is lovingly serviced and saved as much as date. So it must be, thanks for sharing this with us

먹튀검증 说:
2023年11月22日 01:09

you are so exciting! I don’t consider i’ve examine some thing like this before. So great to discover any other character with a few proper mind in this issue. Significantly.. Thanks for beginning this up. This website is some thing that is required at the net, a person with some originality! I quite like studying via a submit which can make males and females assume. Also, many thank you for allowing me to comment! Spot on with this write-up, i genuinely suppose this superb web site needs a remarkable deal more attention. I’ll likely be returning to peer more, thanks for the advice! I’m very thrilled to discover this page. I wanted to thanks on your time for this outstanding read!! I certainly truely favored every little bit of it and i also have you ever saved as a favourite to have a look at new matters to your internet site.

토토커뮤니티목록 说:
2023年11月22日 01:12

Can I just say such a relief to uncover one who really knows what theyre talking about on the web. You actually know how to bring a worry to light and make it important. More and more people have to read this and understand why side with the story. I cant believe youre less popular since you also definitely provide the gift.

메이저토토사이트 说:
2023年11月22日 01:18

you are so exciting! I don’t consider i’ve examine some thing like this before. So great to discover any other character with a few proper mind in this issue. Significantly.. Thanks for beginning this up. This website is some thing that is required at the net, a person with some originality! I quite like studying via a submit which can make males and females assume. Also, many thank you for allowing me to comment! Spot on with this write-up, i genuinely suppose this superb web site needs a remarkable deal more attention. I’ll likely be returning to peer more, thanks for the advice! I’m very thrilled to discover this page. I wanted to thanks on your time for this outstanding read!! I certainly truely favored every little bit of it and i also have you ever saved as a favourite to have a look at new matters to your internet site.

메이저토토주소 说:
2023年11月22日 01:28

Can I just say such a relief to uncover one who really knows what theyre talking about on the web. You actually know how to bring a worry to light and make it important. More and more people have to read this and understand why side with the story. I cant believe youre less popular since you also definitely provide the gift.

해외토토 说:
2023年11月22日 01:36

This is very beneficial, despite the fact that it'll be crucial that you aid click on in which website website link

먹튀사이트 说:
2023年11月22日 01:46

I think this is one of the most significant information for me. And i?€™m glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D. Good job, cheers

온라인카지노 说:
2023年11月22日 02:13

When i receive anyone to this webpage and understand having useful information on identical issues.

메이저토토추천 说:
2023年11月22日 02:17

This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs…

안전카지노사이트 说:
2023年11月22日 02:35

I’m really inspired together with your writing abilities and also with the layout to your weblog. Is this a paid subject matter or did you customize it yourself? Either way keep up the excellent high quality writing, it is uncommon to see a nice weblog like this one nowadays..

안전공원주소 说:
2023年11月22日 03:01

I have not checked in here for some time because I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it my friend :)

สล็อตxo 说:
2023年11月22日 03:14

I have not checked in here for some time because I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it my friend :)

안전놀이터 说:
2023年11月22日 03:21

Hello. I want to ask a little something…is this a wordpress website as we are planning to be switching across to WP. In addition did you make this theme by yourself? Appreciate it.

안전놀이터 说:
2023年11月22日 03:43

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business.

토토사이트 说:
2023年11月22日 03:56

I must express some appreciation to the writer just for rescuing me from such a incident. Just after surfing around throughout the internet and obtaining strategies which are not helpful, I thought my life was well over. Being alive without the approaches to the problems you've resolved as a result of your good report is a critical case, and ones that could have in a negative way damaged my career if I had not noticed your blog. Your actual expertise and kindness in touching almost everything was priceless. I am not sure what I would've done if I hadn't come across such a stuff like this. I can at this moment look ahead to my future. Thanks a lot so much for your expert and sensible help. I won't hesitate to endorse your blog to anyone who needs care on this situation.

우리카지노 说:
2023年11月22日 04:17

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates

먹튀폴리스검증업체 说:
2023年11月22日 04:26

Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates

seo service UK 说:
2023年11月29日 00:48

Cool stuff you have and you keep overhaul every one of us

civaget 说:
2023年12月07日 10:13

백링크하이 exceeded my expectations. Increased organic traffic and higher revenue!

civaget 说:
2023年12月13日 02:08

Embrace the power of 휴식, a lifeline to well-being, vitality, and a balanced life.

civaget 说:
2023年12月13日 03:42

Regular massages with 대전출장마사지 have boosted my mental clarity.

SEO 说:
2023年12月15日 17:50

메이저사이트, a secure betting haven, thanks to Toto Match's vigilance. Trust them for a worry-free gambling experience.

civaget 说:
2023年12月24日 03:30

오산휴게텔 is where relaxation meets excellence. The Swedish massage provided ultimate comfort, and the attentive staff made the experience exceptional.

civaget 说:
2023年12月26日 03:25

If you're a sports fan, don't miss out on 무료실시간TV중계. It's where sports magic happens, and it's completely free!

카지노커뮤니티 说:
2023年12月27日 21:30

긍정적 인 사이트,이 게시물에 대한 정보를 어디서 얻었습니까? 나는 그것을 발견하게되어 기쁘다. 당신이 어떤 추가 포스트를 포함하는지 곧 확인하기 위해 곧 다시 확인할 것이다.

civaget 说:
2024年1月10日 02:14

Experience 강남 토닥이 at Edge Therapy – a sanctuary for women to unwind, rejuvenate, and rediscover tranquility like never before.

먹튀검증 说:
2024年1月14日 21:34

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared.

소액결제현금화 说:
2024年1月15日 02:42

Just admiring your work and wondering how you managed this blog so well. It’s so remarkable that I can't afford to not go through this valuable information whenever I surf the internet!

스포츠중계 说:
2024年1月15日 03:11

So it is intriguing and great composed and see what they think about other individuals.

카지노사이트 说:
2024年1月15日 03:30

"I quite like reading through an article that can make
people think. Also, many thanks for allowing me to comment!"

바카라사이트 说:
2024年1月15日 19:25

Thanks so much for the blog.Really thank you! Want more.

머니맨 说:
2024年1月15日 19:48

I'm amazed, I must say. Seldom do I come across a blog that's both educative and engaging, and without a doubt, you've hit the nail on the head. The problem is something which too few people are speaking intelligently abou

카지노사이트추천 说:
2024年1月15日 20:08

I gotta favorite this website it seems very helpful 

industrial outdoor s 说:
2024年1月15日 20:23

I have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog

먹튀검증 说:
2024年1月15日 20:42

This blog really convinced me to do it! Thanks, very good post

카지노 올인토토 说:
2024年1月15日 20:59

Truly, this article is really one of the very best in the history of articles. I am a antique ’Article’ collector and I sometimes read some new articles if I find them interesting. And I found this one pretty fascinating and it should go into my collection. Very good work!

카지노사이트 说:
2024年1月15日 21:15

Well, there is always a sudden feeling when you see some beautiful information on social media or anywhere else. It’s just you have to convey it in a more beautiful and sophisticated way

카지노뱅크 说:
2024年1月15日 21:44

Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards.

카지노 커뮤니티 说:
2024年1月17日 19:17

Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.

먹튀검증 说:
2024年1月17日 21:42

Excellent points?I would notice that as someone who in reality doesn’t write on blogs a lot (actually, this can be my first publish), I don’t assume the

메이저사이트 说:
2024年1月21日 21:18

온라인 카지노 커뮤니티 온카허브 입니다. 온카허브는 카지노 먹튀 사이트들과 안전한 카지노 사이트 정보를 공유하고 있습니다. 카지노 먹튀검증 전문팀을 자체적으로 운영함으로써 철저한 검증을 진행하고 있습니다.
https://oncahub24.com/

안전놀이터 说:
2024年1月21日 21:24

온라인 카지노 커뮤니티 온카허브 입니다. 온카허브는 카지노 먹튀 사이트들과 안전한 카지노 사이트 정보를 공유하고 있습니다. 카지노 먹튀검증 전문팀을 자체적으로 운영함으로써 철저한 검증을 진행하고 있습니다.

바카라 说:
2024年1月23日 16:28

바카라 바카라사이트 우리카지노 카지노는 바카라, 블랙잭, 룰렛 및 슬롯 등 다양한 게임을 즐기실 수 있는 공간입니다. 게임에서 승리하면 큰 환호와 함께 많은 당첨금을 받을 수 있고, 패배하면 아쉬움과 실망을 느끼게 됩니다.

하노이 밤문화 说:
2024年1月23日 17:09

하노이 꼭 가봐야 할 베스트 업소 추천 안내 및 예약, 하노이 밤문화 에 대해서 정리해 드립니다. 하노이 가라오케, 하노이 마사지, 하노이 풍선바, 하노이 밤문화를 제대로 즐기시기 바랍니다. 하노이 밤문화 베스트 업소 요약 베스트 업소 추천 및 정리.

먹튀검증 说:
2024年1月24日 19:47

No.1 먹튀검증 사이트, 먹튀사이트, 검증사이트, 토토사이트, 안전사이트, 메이저사이트, 안전놀이터 정보를 제공하고 있습니다. 먹튀해방으로 여러분들의 자산을 지켜 드리겠습니다. 먹튀검증 전문 커뮤니티 먹튀클린만 믿으세요!!

베트남 밤문화 说:
2024年1月24日 21:10

베트남 남성전용 커뮤니티❣️ 베트남 하이에나 에서 베트남 밤문화를 추천하여 드립니다. 베트남 가라오케, 베트남 VIP마사지, 베트남 이발관, 베트남 황제투어 남자라면 꼭 한번은 경험 해 봐야할 화끈한 밤문화로 모시겠습니다. 

카지노사이트 说:
2024年4月05日 16:20

온라인 카지노 커뮤니티 온카허브 입니다. 온카허브는 카지노 먹튀 사이트들과 안전한 카지노 사이트 정보를 공유하고 있습니다. 카지노 먹튀검증 전문팀을 자체적으로 운영함으로써 철저한 검증을 진행하고 있습니다

블록체인개발 说:
2024年4月22日 23:05

블록체인개발 코인지갑개발 IT컨설팅 메스브레인팀이 항상 당신을 도울 준비가 되어 있습니다. 우리는 마음으로 가치를 창조한다는 철학을 바탕으로 일하며, 들인 노력과 시간에 부흥하는 가치만을 받습니다. 고객이 만족하지 않으면 기꺼이 환불해 드립니다.
https://xn--539awa204jj6kpxc0yl.kr/

Cryto exchange 说:
2024年6月02日 17:07

The tech-original mission is to help you better understand technology, and make better decisions in the fields of IT, Tech, and Crypto.
https://www.tech-original.com/


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter