Visually identify name of field in PDF form
Asked Answered
Q

4

15

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 ?

Quiteris answered 8/7, 2016 at 0:9 Comment(1)
See also: How to view form field names in a pdf documentCordy
Q
31

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

https://www.pdfescape.com/

Click Edit -> select field -> Click on the wrench icon in toolbar -> name appears in popup

Quiteris answered 8/7, 2016 at 0:14 Comment(5)
Did you manage to find any other tools that display the names of the form fields inside a PDF document?Fen
Very awesome Trick Thanks ManBrookweed
I don't see unlock, not working for meImpassable
This worked a year ago. I've come back to this website and it seems like their site has changed and this is no longer possible.Rag
It's still possible, I've updated the steps in the answer to match current version.Frontward
W
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

Witted answered 4/1, 2020 at 10:1 Comment(4)
How does this Visually identify name of field in PDF form? Which is what the OP asked for after all...Scuttlebutt
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.Witted
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.Scuttlebutt
I am not too familiar with java, could you show how to get this result?Curch
O
5

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.

Obstreperous answered 24/9, 2021 at 8:1 Comment(1)
Yes but they are not visually located in the pdf like I asked.Quiteris
T
5

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.

Troat answered 30/5, 2023 at 10:18 Comment(1)
This works ok, though it only gave me the field name, and not the full path of the field. e.g. it shows p1-t4[0] instead of the full field path topmostSubform[0].Page1[0].LineC[0].p1-t4[0]. Its enough for some since the other answer from user2267379 no longer seems to exist.Emigrate

© 2022 - 2024 — McMap. All rights reserved.