14

I know some similar issues exist (Find the field names of inputtable form fields in a PDF document?) but my question is different:

I have all the field names (in fdf file).

I wish I could visually identify directly on the PDF.

With acrobat I should be able to right click on a field and then select "display the name of the field" but I can find no such thing.

Can someone help me ?

user2267379
  • 1,067
  • 2
  • 10
  • 20
  • See also: [How to view form field names in a pdf document](https://superuser.com/questions/137227/how-to-view-form-field-names-in-a-pdf-document/) – daviewales Apr 11 '23 at 02:22

4 Answers4

31

Ok. I have found pdf editor where this is possible. Probably acrobat pro too...

http://www.pdfescape.com/

Right click on the field : unlock. Right click again : get properties.

user2267379
  • 1,067
  • 2
  • 10
  • 20
8

If you're using Apache PDFBox to fill the form automatically, you can use it to fill all text fields with their name:

final PDDocument document = PDDocument.load(in);
final PDAcroForm acroForm = document.getDocumentCatalog().getAcroForm();
final Iterator<PDField> it = acroForm.getFieldIterator();

for (PDField f : acroForm.getFields()) {
    System.out.println(f.toString());

    if (f instanceof PDTextField) {
        f.setValue(f.getFullyQualifiedName());
    }
};

document.save(...);

When you open the generated PDF, you'll be able to identify each field immediately like you asked.

example

Bastien Jansen
  • 8,756
  • 2
  • 35
  • 53
  • How does this ***Visually** identify name of field in PDF form*? Which is what the OP asked for after all... – mkl Jan 04 '20 at 17:21
  • 3
    Well when you open the output PDF, every text field is filled with its name, so just by looking at a field you can see (and copy) its name. – Bastien Jansen Jan 05 '20 at 08:13
  • Arg, right, sorry, I missed your actual proposal. You're right, that indeed is a way. There are some forms and fields it won't for (check boxes, too small fields, forms with javascript clearing fields on view start,...) but for many it will. – mkl Jan 05 '20 at 09:21
  • I am not too familiar with java, could you show how to get this result? – Nivatius May 12 '20 at 18:56
3

There's a free tool that does this job quite well.

sudo apt install pdftk

You can use pdftk's dump_data_fields to get all fields like this:

pdftk sample.pdf dump_data_fields output fields.txt

Dump would look something like this:

FieldType: Text
FieldName: CRIssue
FieldFlags: 8388608
FieldValue: Issue with something ---- if it is filled
FieldJustification: Center

If you're looking for a tool where you can load your editable pdf file, click on the input (text or checkbox) field and get the basic info like Name: https://code-industry.net/masterpdfeditor/. It's available cross-platform.

Sumit Wadhwa
  • 2,825
  • 1
  • 20
  • 34
0

I found this website which will allow you to upload a pdf, visualize that pdf, click on any fillable field of this pdf, and see all the properties of that field including its name.

Here's that website: https://extract-fillable-fields.pdffiller.com/

You'll have to click on the green tabs on the right with the label EDIT FILLABLE FIELDS to see those fields details.

Moebius
  • 6,242
  • 7
  • 42
  • 54