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

Checked state of PDCheckbox

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 3.0.0 PDFBox
    • None
    • AcroForm
    • None

    Description

      Before v3.0.0 is was possible to get the selected state simply by using the isChecked() function. After updating to v.3.0.0 the function always returns false with the same input PDF that works well til v2.0.30.

      There are no migration advices so I think this is a bug.

      This is the code I use for filtering selected checkboxes. but now always returns an empty list (in contrast to v2.0.30)

      private List<PDField> filterCheckedCheckboxes(List<PDField> fields) {
        return filterByType(fields, PDCheckBox.class)
         .stream()
         .filter(PDCheckBox::isChecked)
         .map(PDField.class::cast)
         .toList();
      }

       

      I can also find no test for PDCheckBox.isChecked()

      Attachments

        1. ticket.pdf
          86 kB
          Michael Bädorf

        Activity

          People

            Unassigned Unassigned
            michael.baedorf Michael Bädorf
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: