title: How to get AcroField Properties using iText?
body: <p>I am using iText to read a pdf file. I have 20 Acro text fields in my pdf with different fillColor properties. I tried to read the properties but could not able to read. Is there any way we can get the fields which have a particular color as their fillcolor property in java? </p>
  
  <p><strong>EDIT:</strong>
  I created acro fields in the pdf using the following Adobe Javascript </p>
  
  <pre><code>   var oFld = this.addField("nameOfField", "button", 0, fldRect);
      if (oFld != null) {
          oFld.buttonSetCaption("");
          oFld.borderStyle = border.s;
          oFld.fillColor = color.gray;
          oFld.textColor = color.white;
          oFld.lineWidth = 1;
      }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>now I am able to read the color properties.</p>
  
  <p>Am not sure whether it is the right way to do it or not?</p>
  
  <pre><code>  if(dict.getAsDict(PdfName.MK).get(PdfName.BG) !=null){
              if(dict.getAsDict(PdfName.MK).get(PdfName.BG).toString().trim().equals("     
      [0.0, 1.0, 0.0]")){
                  System.out.println(entry.getKey());
                  System.out.println("Green");
              }
              if(dict.getAsDict(PdfName.MK).get(PdfName.BG).toString().trim().equals("
          [1.0, 0.0, 0.0]")){
                  System.out.println(entry.getKey());
                  System.out.println("Red");
              }
  
          }
  </code></pre>