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 2021/08/12 14:00:00 UTC

[jira] [Commented] (PDFBOX-5225) Flattening removes all annotations when widget annotation has no page

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

Maruan Sahyoun commented on PDFBOX-5225:
----------------------------------------

The failing test is because of the fix up kicking in so somewhat unrelated. I've created a small JUnit test which uses the proposed code and removes the /P entry from the widget.  That works. Need to further check why after the change the test fails.

> Flattening removes all annotations when widget annotation has no page
> ---------------------------------------------------------------------
>
>                 Key: PDFBOX-5225
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5225
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.24
>            Reporter: Tilman Hausherr
>            Priority: Major
>         Attachments: SourceFailure.pdf
>
>
> {code}
>         PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
>         List<PDField> list = new ArrayList<>();
>         list.add(acroForm.getField("VN_NAME"));
>         acroForm.flatten(list, true); 
> {code}
> The code from buildPagesWidgetsMap that is run when there are widgets with missing page references does not consider the field list. So all widgets end up in the map instead of only those we care about.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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