[ 
https://issues.apache.org/jira/browse/PDFBOX-5439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540247#comment-17540247
 ] 

Michael Klink commented on PDFBOX-5439:
---------------------------------------

Let's have a look at the spec...

h3. ISO 32000-1

{panel:title=ISO 32000-1, section 12.7.3.2 "Field Names"}
It is possible for different field dictionaries to have the same fully 
qualified field name if they are descendants of a common ancestor with that 
name and have no partial field names (*T* entries) of their own. Such field 
dictionaries are different representations of the same underlying field; they 
should differ only in properties that specify their visual appearance. In 
particular, field dictionaries with the same fully qualified field name shall 
have the same field type (*FT*), value (*V*), and default value (*DV*).
{panel}

As _such field dictionaries are different representations of the same 
underlying field_, it is appropriate to treat them as a single field. One 
merely must make sure that the non-widget properties of all the different 
representations of the field are the same and are used as properties of one's 
field object, not the properties of the base field itself.

h3. ISO 32000-2

{panel:title=ISO 32000-2, 12.7.4.2 Field names}
A field dictionary that does not have a partial field name (*T* entry) of its 
own shall not be considered a
field but simply a Widget annotation. Such annotations are different 
representations of the same
underlying field; they should differ only in properties that specify their 
visual appearance. In addition,
actual field dictionaries with the same fully qualified field name shall have 
the same field type (*FT*),
value (*V*), and default value (*DV*).
{panel}

If working with the current PDF standard, the "different fields with the same 
name" in the example explicitly are merely different widget annotations of the 
same field.

> Details of form fields with same form field name not getting stored using 
> PDAcroform
> ------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5439
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5439
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: AcroForm
>            Reporter: Shubham Gupta
>            Priority: Minor
>         Attachments: Expected And Actual Result.docx, SAMPLE PDF.pdf, sample 
> code.txt
>
>
> Steps to reproduce:
>  # Develop a program that will take the PDF in PDDocument and then get the 
> Acroform details in PDAcroform now in a list of PDField try to get all the 
> fields. (I have attached a sample code for a better understanding of the 
> team).
>  # Now use a PDF which is having forms and keep two form fields with the same 
> name (let's say you are using Adobe Acrobat when you will go to tools and 
> then to Forms and then to Edit Form option and when you will click any form 
> field TEXT FIELD PROPERTIES will open. Just Go Click on the General tab and 
> Keep the two form fields names the same.)
>  # Now if the PDF contains in total of 10 form fields, the list the we got 
> from pdfbox that we have will be of size 9, This is because PDAcroform is not 
> taking those form fields that have the same form field name, they are storing 
> only those form fields whose name are unique. 
>  # This needs to be improved so that a developer using PDFBOX library, which 
> is by the way superb,  wants to validate those Form Fields which have no 
> tooltip and the duplicate form fields are the ones that don't have a tooltip 
> but since only one is getting stored he will get the wrong result every time, 
> I have given a simple example to make the team understand but this needs to 
> be improved.
> Please find the attachment for your reference.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to