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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1
    • 1.3.1
    • PDModel
    • None
    • 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. screenshot-1.jpg
          434 kB
          Yonas Jongkind
        2. PDChoiceField.java
          3 kB
          Yonas Jongkind

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: