Am 18.08.2015 um 20:50 schrieb Roberto Nibali:
Hi

I'd like to print out the corresponding object id given a specific form
field. How would I do that with PDFBox programmatically?

Let's for the sake of the argument, assume that the form field is
represented by the following obj:

obj 218 0
   <<
     /DA <2B94B0298F2FD7F81F32C6E22043>
     /F 4
     /FT /Tx
     /Ff 4194304
     /MK
     /P 28 0 R
     /Parent 46 0 R
     /Rect [159.781 764.53 347.142 777.195]
     /Subtype /Widget
     /T <5EB6B730886188AB3D3194B9654C18094C>
     /Type /Annot
     /V <45BBBA249C618BBD3974A4BE61501E57181D>
     /AP 666 0 R
   >>

If I am going over all PDField entries of a PDF, how would I get to the
underlying obj number (in the above case 218) from a PDField object?

I haven't tried this myself, but I think you could "synchronise" the getChildren() results with the getCOSObject().getItem(COSName.KIDS) array, i.e. sort out which indirect type is which item returned from getChildren(). The Kids COSArray has indirect objects (= COSObject type), as seen here:



COSObject.getObject() returns the dereferenced object.

Tilman

Reply via email to