Fill in a simple registration form : Form Fill « PDF RTF « Java

Fill in a simple registration form


import com.lowagie.text.pdf.AcroFields;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfStamper;

// SimpleRegistrationForm.pdf is from 

 * Fill in a simple registration form.
public class FormFillPDF {
  public static void main(String[] args) {
    try {
      PdfReader reader = new PdfReader("SimpleRegistrationForm.pdf");
      // filling in the form
      PdfStamper stamp1 = new PdfStamper(reader, new FileOutputStream("FormFillPDF.pdf"));
      AcroFields form1 = stamp1.getAcroFields();
      form1.setField("name", "your name");
      form1.setField("address", "Your Address");
      form1.setField("postal_code", "1111");
      form1.setField("email", "email");
    } catch (Exception de) {

       1,748 k)

Related examples in the same category

1.Form Fill and Make it Flatten
2.Form SignatureForm Signature