Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing font sizes from PDF files in Java

I need to write a program that can find the largest text in a PDF document (which is probably the title!), I've tried using Tika as a parser but I couldn't find a way to get the font size. Also the Tika library seems too powerful and complex for my use. Is there an easier way/library that I can use? Is it easier or better to not use a library and parse the PDF myself (I am kinda interested in this approach)? If so, where should I start?

Any information is greatly appreciated.

like image 461
Auxiliary Avatar asked Jul 12 '26 06:07

Auxiliary


1 Answers

I found this method on SO that overrides the processTextPosition from PDFTextStripper in the PDFBox library and extracts the font size. I didn't see it before because the post's question was a bit different.

like image 127
Auxiliary Avatar answered Jul 14 '26 04:07

Auxiliary



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!