title: Re: pdfbox library ; Has anyone discovered how to add text fields to a pdf?
body: <p>Trying to use pdfbox to create pdf with form fields that can be filled in by user or computer.
  So far my code looks like this:</p>
  
  <pre><code>PDDocument doc = new PDDDocument();
  PDPage page = new PDPage();
  doc.addPage(page)
  PDAcroForm = new PDAcroForm(doc)
  doc.documentCatalog.setAcroForm(acroForm)
  COSDictionary cosDict = new COSDictionary()
  PDTextbox textField = new PDTextbox(acroForm, cosDict)
  PDRectangle rect = new PDRectangle()
  rect.setLowerLeftX((float) 250)
  rect.setLowerLeftY((float) 125)
  rect.setUpperRightX((float) 500)
  rect.setUpperRightY((float) 75)
  textField.getWidget().setRectangle(rect)
  acroForm.getFields.add(textField)
  page.getAnnotations().add(textField)
  page.getAnnotations().add(textField.getWidget())
  </code></pre>