1

Goal: My intent is to help a user outside of my organization upload any multipage PDF that has multiple fillable fields inside of PDF document where some of the fields were unknowingly tagged with the same name. If the users were internal we could request that they tag the PDF with unique names but we don't have that luxury in this case. We need to find and fix issues using iTextSharp without bothering the user and/or partially detecting their tagged fields.

Current State: What happens today when using iTextSharp is that only distinctly-named fields are detected. Fields that are using identical names as others are "ignored" for all intents and purposes.

Example: I have a PDF with three tagged fields named as follows: One, One, Three. When I run the PDF through iTextSharp, it is only picking up two AcroFields (One and Three). The second field named "One" is not in the AcroFields collection. What is interesting is that all three fields ARE in the AcroForm.Fields collection but has limited MetaData information about each field. The information I can access within the AcroForm.Fields items are "/DA, /DR, /FT, and /T". None of these have what I am looking for (below).

Question: I have code to add a new field to the AcroFields collection and it is working but I am missing information about the second "One" field and need to pull key information such as height, width, page number, x, y coords of where that field was. My plan is to dynamically add the missing AcroFields back into the document such that the textbox is positioned correctly and is the appropriate size when the user sees it later. The end result would be that the user sees no visual difference, isn't notified of issues, and is fully corrected by implementation I am working on.

Thoughts or suggestions?

Of course, if I have missed anything in this question or if the approach is wrong please advise.

Solo812
  • 401
  • 1
  • 8
  • 19
  • Please post the pdf with the problem, the devil is in the details and without the pdf we would only be guessing. – Paulo Soares Jul 06 '17 at 08:17
  • http://devbrightadmin.azurewebsites.net/FileBrowser/Uploads/DevBright/temp/Doc12.pdf This is a basic pdf with 3 fields. 2 of the 3 have the same field name of "One". I am attempting to detect the duplicate name (second instance on) and then rename it. The issue is that in iTextSharp, when I look at the AcroFields collection, it has only detected 2 of the 3 (The first field named "One" and the field named "Three"). But the AcroForm Fields collection has all three. – Solo812 Jul 06 '17 at 14:17
  • You ever solve this? – Tronald Oct 04 '17 at 17:03
  • No. This is still an issue. – Solo812 Dec 10 '17 at 15:35

0 Answers0