title: PDF acroform fields become non editable in Adobe reader after writing to it using Pdfbox APIs
body: <p>I am reading a PDF which has editable fields and the fields can be edited by opening it through Adobe Reader. I am using PDFBox APIs to generate an output PDF with data filled for the editable fields in input PDF. The output PDF can be opened using Adobe Reader and I am able to see the field values but I am unable to edit those fields directly from Adobe reader.</p>
  
  <p>There is also a JIRA ticket for this issue and it is unresolved according to this link :</p>
  
  <p><a href="https://issues.apache.org/jira/browse/PDFBOX-1121" rel="nofollow">https://issues.apache.org/jira/browse/PDFBOX-1121</a></p>
  
  <p>Can anybody please tell me if this got resolved? Also, if possible please answer the following questions related to my question:</p>
  
  <ol>
  <li><p>Is there any protection policy or access permission that I need to explicitly set in order to edit the output PDF from Adobe reader?</p></li>
  <li><p>Every time I open the PDF that was written to using pdfbox APIs, I get this message prompt:</p></li>
  </ol>
  
  <blockquote>
    <p>" The document has been changed since it was created and use of extended features is no longer available...."</p>
  </blockquote>
  
  <p>I am using PdfBox 1.8.6 jar and Adobe reader 11.0.8. I would really appreciate if anybody could help me with this issue.</p>
  
  <p>Code snippet added to aid responders in debugging :</p>
  
  <pre><code>String outputFileNameWithPath = "C:\myfolder\testop.pdf";
  PDDocument pdf = null;
  pdf = PDDocument.load( outputFileNameWithPath );
  
  PDDocumentCatal og docCatalog = pdf.getDocumentCatalog();
  PDAcroForm acroForm = docCatalog.getAcroForm();
  //The map pdfValues is a collection of the data that I need to set in the PDF
  //I am unable to go into the details of my data soutce
  // The key in the data map corresponds to the PDField's expanded name and data
  //  corresponds to the data that I am trying to set.
  Iterator&lt;Entry&lt;String, String&gt;&gt; iter=pdfValues.entrySet().iterator();
  String name=null;
  String value=null;
  PDField field=null;
  //Iterate over all data and see if the PDF has a matching field.
  while(iter.hasNext()) {
      Map.Entry&lt;String, String&gt; currentEntry=iter.next();
      name=currentEntry.getKey();
      value=currentEntry.getValue();
      if(name!=null) {
          name=CommonUtils.fromSchemaNameToPdfName(name);
          field=acroForm.getField(name);      
      }
      if( field != null &amp;&amp; value!=null )
          {           
              field.setValue( value ); //setting  the values once field is found.
          }
  }
  // Set access permissions / encryption here before saving
  pdf.save(outputFileNameWithPath);
  </code></pre>
  
  <p>Thanks.</p>