Source Code : Form Fill and Make it Flatten
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
Form Fill and Make it Flatten
import java.io.FileOutputStream;
import com.lowagie.text.pdf.AcroFields;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfStamper;
public class FormFillAndMakeItFlattenPDF {
public static void main(String[] args) {
try {
PdfReader reader = new PdfReader("SimpleRegistrationForm.pdf");
PdfStamper stamp2 = new PdfStamper(reader, new FileOutputStream("FormFillAndMakeItFlattenPDF.pdf"));
AcroFields form2 = stamp2.getAcroFields();
form2.setField("name", "your name");
form2.setField("address", "address");
form2.setField("postal_code", "code");
form2.setField("email", "youremail");
stamp2.setFormFlattening(true);
stamp2.close();
}
catch (Exception de) {
de.printStackTrace();
}
}
}
Thank with us