You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (Jira)" <ji...@apache.org> on 2023/11/27 12:51:00 UTC

[jira] [Commented] (PDFBOX-5720) Checked state of PDCheckbox

    [ https://issues.apache.org/jira/browse/PDFBOX-5720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17790071#comment-17790071 ] 

Maruan Sahyoun commented on PDFBOX-5720:
----------------------------------------

Can you attach the PDF in question and the name of the field for which you'd like to get the state?

BR

Maruan

> Checked state of PDCheckbox
> ---------------------------
>
>                 Key: PDFBOX-5720
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5720
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Michael Bädorf
>            Priority: Major
>
> 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)
> {{{color:#000080}private {color}List<PDField> filterCheckedCheckboxes(List<PDField> fields) {}}
> {{  {color:#000080}return {color}filterByType(fields, PDCheckBox.{color:#000080}class{color})}}
> {{   .stream()}}
> {{   .filter(PDCheckBox::isChecked)}}
> {{   .map(PDField.{color:#000080}class{color}::cast)}}
> {{   .toList();}}
> }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org