lefnire wrote:
> I'm using AcroFields.getFields() to read fields from a PDF.  I'm wondering,
> is there anyway to retrieve each form-field's associated label?  So for
> example, if I have
> 
> Enter Name: __________
> 
> I can get the field (aka, the underline representing a text-field), but can
> I get "Enter Name" and can I determine that it is associated with that
> name_text_field?

You need to understand PDF to know why this is impossible:

The definition of the _______ field is a dictionary: it's a field
dictionary + widget annotation dictionary. In that dictionary, you'll
find the coordinates on the page. You'll probably also find a reference
to an appearance stream.

The syntax to draw "Enter Name:" on the page is part of the page
content stream. Read Mark Storer's remarks in this FAQ entry:
http://www.1t3xt.com/docs/faq.php?branch=faq.pdf_in_general&node=replace_word
It's very difficult to find the location of "Enter Name:" on the page,
and there's no relation whatsoever between the 'glyphs' that make up
"Enter Name:" and the dictionary responsible for the field.

Your best shot is to inspect the field dictionary and hope a
user friendly name for the field is provided by the author of
the form.
-- 
This answer is provided by 1T3XT BVBA

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to