You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (Jira)" <ji...@apache.org> on 2022/05/19 15:00:00 UTC

[jira] [Commented] (PDFBOX-5439) Details of form fields with same form field name not getting stored using PDAcroform

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

Maruan Sahyoun commented on PDFBOX-5439:
----------------------------------------

The number of form fields you are getting from PDFBox is correct.

A form field in PDF has two kind of related informations 
- the field definition (e.g. it's type, name ...) (PDField)
- the visual representation (the location, the font being used, color ...) (PDAnnotationWidget) 

Using the same (fully qualified) name multiple times represents only a single PDField but with multiple PDAnnotationWidget. 

Using PDField.getWidgets() will give you List<PDAnnotationWidget> to inspect.

> 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
>            Reporter: Shubham Gupta
>            Priority: Major
>         Attachments: Expected And Actual Result.docx, 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-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org