Hello,
 
I'm trying to find a way to determine the font-size used in a pdf document =
using pdfbox.
I understand how to get at the fonts using  code like:
 
                List allPages =3D document.getDocumentCatalog().getAllPages();
                PDPage firstPage =3D (PDPage)allPages.get( 0 );
 
                PDResources pdResources = firstPage.findResources();
                Map<String, PDFont> fonts = pdResources.getFonts();
 
however, this does not get you the font-size such as 12pt... etc. I tried:

                PDResources pdResources = firstPage.findResources();
 
                Map<String, PDExtendedGraphicsState> graphicsStates =
pdResources.getGraphicsStates();

 
but this just returns null for graphicStates so my document must not have a=
 graphics dictionary. What am I to do.
 
The goal for me is to figure out how approximately how many lines of text a=
re on a page and how many columns. In order
to figure out how many columns=2C I need to know about how wide the average=
 character in the charset is in pixels, and
in order to know that I need the font-size. Perhaps there is a way I can ca
lculate this information using the PDFont data
that I do have, however, I haven't been able to figure it out. Any help
 would be appreciated.
 
Thanks,
 
Tom
 
                                          
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/210850553/direct/01/

Reply via email to