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

PDChoiceField's implementation of SetValue does not work for all PDF forms. Sometimes it throws ClassCastException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: 1.3.1
    • Component/s: PDModel
    • Labels:
      None
    • Environment:
      Java6/MacosX

      Description

      For a choice with the following options:

      COSArray{[COSString{ }, COSArray{[COSString

      {NR}

      , COSString

      {Non-reactive}

      ]}, COSArray{[COSString

      {R}

      , COSString

      {Reactive}

      ]}, COSArray{[COSString

      {Declined}, COSString{Declined}

      ]}]}

      A class cast is thrown as the code expects all items to be strings as the first item is a string. However, the remaining items are all pairs.

      The attached code is the fix. It just makes the pair/single check every time through the loop.

        Attachments

        1. PDChoiceField.java
          3 kB
          Yonas Jongkind
        2. screenshot-1.jpg
          434 kB
          Yonas Jongkind

          Activity

            People

            • Assignee:
              jukkaz Jukka Zitting
              Reporter:
              yonas.jongkind@gmail.com Yonas Jongkind
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: