title: PDFBox : How can a PDAcroForm be flattened?
body: <p>I am using PDFBox library to populate PDF forms but I am not able to flatten them. I have already tried the following solutions:</p>
  
  <pre><code> PDAcroForm acroForm = docCatalog.getAcroForm();
   PDField field = acroForm.getField( name );
   field.setReadonly(true); //Solution 1
   field.getDictionary().setInt("Ff",1);//Solution 2
  </code></pre>
  
  <p>But nothing seems to be working. Please suggest a solution for the same.</p>