views:

10

answers:

0

Hi,

From PDF, i need to read the co-ordinates of the fields such as, ascent descent of the fields, using PDFBox API. The COS dictioanary object contains those information i guess. As of now i can able to retrieve the rect box of the fields which includes x,y,height and width. But i need to get the baseline which in turn depends on ascend and descent info of the font used in the fields. Please help me to retrieve these information.

The dictioanry object is look like this,

(COSName{Resources}:COSDictionary{(COSName{ProcSet}:COSArray{[COSName{PDF}, COSName{ImageB}, COSName{ImageC}, COSName{ImageI}, COSName{Text}]}) (COSName{Font}:COSDictionary{(COSName{F0}:COSDictionary{(COSName{Type}:COSName{Font}) (COSName{Subtype}:COSName{TrueType}) (COSName{BaseFont}:COSName{OCR-AII}) (COSName{FontDescriptor}:COSDictionary{(COSName{Type}:COSName{FontDescriptor}) (COSName{Ascent}:COSInt{649}) (COSName{CapHeight}:COSInt{604}) (COSName{Descent}:COSInt{-176}) (COSName{Flags}:COSInt{32}) (COSName{FontBBox}:COSArray{[COSInt{-5}, COSInt{-177}, COSInt{875}, COSInt{931}]}) (COSName{FontName}:COSName{OCR-A II}) (COSName{ItalicAngle}:COSInt{0}) (COSName{StemV}:COSInt{87}) (COSName{XHeight}:COSInt{428}) (COSName{MissingWidth}:COSInt{1000}) (COSName{FontFile2}:COSDictionary{(COSName{Length}:COSInt{17192}) (COSName{Filter}:COSName{FlateDecode}) (COSName{Length1}:COSInt{28532}) }) }) (COSName{FirstChar}:COSInt{32}) (COSName{LastChar}:COSInt{253})