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

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

Artem Logachev created PDFBOX-3941:
--------------------------------------

             Summary: 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