Source Code : Fill in a simple registration form

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Fill in a simple registration form

import java.io.FileOutputStream;

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

// SimpleRegistrationForm.pdf is from http://itextdocs.lowagie.com/tutorial/ 

/**
 * 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");
      stamp1.close();
    } catch (Exception de) {
      de.printStackTrace();
    }
  }
}

           
       

Thank with us