In this iText 5 example, we'll create a text field and we'll add it to a PDF:
public void manipulatePdf(String src, String dest) throws DocumentException, IOException {
PdfReader reader = new PdfReader(src);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
TextField tf = new TextField(stamper.getWriter(),
new Rectangle(110, 780, 180, 806), "text");
tf.setBorderColor(BaseColor.BLUE);
tf.setBorderWidth(2);
tf.setTextColor(BaseColor.RED);
tf.setFontSize(12);
tf.setText("Text field");
PdfFormField field = tf.getTextField();
stamper.addAnnotation(field, 1);
stamper.close();
reader.close();
}
Source: developers.itextpdf.com