Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3218

PDFMergerUtility improperly merges AcroForms, causing some forms to break

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: AcroForm, Utilities
    • Labels:
      None

      Description

      In PDFMergerUtility.mergeAcroForm, adding a parent field to the destination fields automatically adds the children, but the code does not account for this. The result is that the same fields get added many times with different names. This is a silent error for most PDFs. However, for some forms, the resultant PDFs cause SOM expression errors in Adobe Reader.

      This problem can be reproduced by appending the following PDFs in the order listed:
      http://www.vba.va.gov/pubs/forms/VBA-21-4185-ARE.pdf
      http://www.vba.va.gov/pubs/forms/VBA-21-534EZ-ARE.pdf

      We were able to fix this issue for our purposes by forking the github mirror and altering the mergeAcroForm method to only append fields whose parent is null.

        Attachments

          Activity

            People

            • Assignee:
              msahyoun Maruan Sahyoun
              Reporter:
              rsby Rees Byars
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: