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

Problem when setting COSName.Off on radio button

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.0.4
    • Fix Version/s: 2.0.5, 3.0.0 PDFBox
    • Component/s: AcroForm
    • Labels:
      None

      Description

      The following error occurs when trying to set the radio button to COSName.Off when the field contains /Opt values:

      ERROR (PDFDocument.java:98) - Error populating form us/gov/opm/SF2817
      java.lang.ArrayIndexOutOfBoundsException: -1
      	at java.util.ArrayList.elementData(ArrayList.java:418) ~[na:1.8.0_45]
      	at java.util.ArrayList.get(ArrayList.java:431) ~[na:1.8.0_45]
      	at org.apache.pdfbox.pdmodel.common.COSArrayList.get(COSArrayList.java:544) ~[pdfbox-2.0.3.jar:2.0.3]
      	at org.apache.pdfbox.pdmodel.interactive.form.PDButton.constructAppearances(PDButton.java:275) ~[pdfbox-2.0.3.jar:2.0.3]
      	at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:228) ~[pdfbox-2.0.3.jar:2.0.3]
      	at org.apache.pdfbox.pdmodel.interactive.form.PDButton.setValue(PDButton.java:167) ~[pdfbox-2.0.3.jar:2.0.3]
      

      the code that triggers the error is:

      field.setValue(COSName.Off.getName());
      

        Attachments

        1. test.pdf
          6 kB
          Tilman Hausherr
        2. SF1199AEG (Complete).pdf
          77 kB
          Scott Coldwell

          Activity

            People

            • Assignee:
              msahyoun Maruan Sahyoun
              Reporter:
              scoldwell Scott Coldwell
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: