title: PDF form fill with PDFBox doesn't work
body: <p>I have a PDF file with some form fields that I need to fill in from Java code. I use PDFBox library for this, and this code:</p>
  
  <pre><code>PDDocument pdfDoc = PDDocument.load("C:\\Users\\igor\\Desktop\\test.pdf");
  PDDocumentCatalog docCatalog = pdfDoc.getDocumentCatalog();
  PDAcroForm acroForm = docCatalog.getAcroForm();
  PDField field = acroForm.getField("applicationPrepaid[0].#pageSet[0].Pagina1[0].txtFirstName[0]");
  if (field != null) {
      field.setValue("Milan");
  } else {
      System.err.println("No field found with name:" + "applicationPrepaid[0].#pageSet[0].Pagina1[0].txtFirstName[0]");
  }
  pdfDoc.save("C:\\Users\\igor\\Desktop\\testout.pdf");
  pdfDoc.close();
  </code></pre>
  
  <p>The PDF is not created by me, so I don't know what type of form the file uses (if I understand correctly, there are FDF and XFA forms). Since the PDF is not created by me, I used this tool <a href="http://support.persits.com/pdf/demo_formfields.asp">http://support.persits.com/pdf/demo_formfields.asp</a> to find out the names of the form fields, and it gave me this:</p>
  
  <pre><code>applicationPrepaid[0].#pageSet[0].Pagina1[0].txtFirstName[0]
  </code></pre>
  
  <p>When I use this long field name, I don't get any errors, but the resulting PDF does not contain the value I put in the field. I thought that maybe there was something wrong with the field name, so I used <a href="http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/">Pdftk tool</a> which gave me just <code>txtFirstName</code> for the field name. But when I use just that, I get the <code>No field found with name: txtFirstName</code> error. Help?</p>