title: NPE when using itext
body: <p>I have a fillable pdf form, made with LC Designer. 
  I want to fill it out automatically using iText:</p>
  
  <pre><code>    public void fillOut(String input, String output, boolean remove, boolean preserve) throws IOException, DocumentException{
      PdfReader reader = new PdfReader(input);
      if (remove) 
          reader.removeUsageRights();
      PdfStamper stamper;
      if(preserve){
          System.out.println("preserve");
          stamper = new PdfStamper(reader, new FileOutputStream(input), '\0', true);
      }else{
          System.out.println("don't preserve");
          stamper = new PdfStamper(reader, new FileOutputStream(output));
      }
      AcroFields form = stamper.getAcroFields();
      Map&lt;String,Item&gt; fields = form.getFields();
      System.out.println(fields.size());
      for (Entry&lt;String, Item&gt; ent: fields.entrySet()) {
          System.out.println("[" + ent.getKey() + "] [" + ent.getValue() + "]");
      }
      form.setField("Text", "test text");
  
      stamper.close();
  }
  </code></pre>
  
  <p>But this code produses NPE:</p>
  
  <pre><code>Exception in thread "main" java.lang.NullPointerException
      at com.itextpdf.text.pdf.XfaForm.findFieldName(XfaForm.java:294)
      at com.itextpdf.text.pdf.AcroFields.setField(AcroFields.java:1387)
      at com.itextpdf.text.pdf.AcroFields.setField(AcroFields.java:1316)
      at FillOutForm.fillOut(FillOutForm.java:40)
      at AcroTest.main(AcroTest.java:13)
  </code></pre>
  
  <p>At the same time, when i use the same method, fillOut(String input, String output, boolean remove, boolean preserve), to fill out form, which was previously created with iText - everything is ok.</p>
  
  <p><a href="https://dl.dropbox.com/u/45422316/PDFforms.7z" rel="nofollow">Here is</a> 7z archive with both pdfs, LCtest.pdf made with LC designer, and generates error, itest.pdf - is made with itext and works fine. 
  So, what is wrong? Is it something wrong in my code, or it is bug?</p>
  
  <p><strong>PS:</strong> iText version i'm using is 5.1.3, and 5.3.5 acts the same way.</p>