You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2017/09/26 14:55:00 UTC

[jira] [Closed] (PDFBOX-3941) PDAcroForm.flatten(List, boolean) works incorrectly

     [ https://issues.apache.org/jira/browse/PDFBOX-3941?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr closed PDFBOX-3941.
-----------------------------------
    Resolution: Duplicate

Duplicate of PDFBOX-3809. I'll add you as a watcher there.

> PDAcroForm.flatten(List<PDField>, boolean) works incorrectly
> ------------------------------------------------------------
>
>                 Key: PDFBOX-3941
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3941
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.7
>            Reporter: Artem Logachev
>         Attachments: flatten_fields.pdf, flatten_result.pdf
>
>
> Documentation for *PDAcroForm.flatten(List<PDField>, boolean)* says "This will flatten the specified form fields".
> But the following code works same as *PDAcroForm.flatten()* though excepted to flatten only one field.
> {code:java}
> PDDocument document = PDDocument.load(new File("/flatten_fields.pdf"));
> PDAcroForm acroForm = document.getDocumentCatalog().getAcroForm();
> List<PDField> fields = new ArrayList<>(); 
> fields.add(acroForm.getField("flatten"));
> acroForm.flatten(fields, true);
> document.save("/flatten_result.pdf");
> document.close();
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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