public static void main(String[] args) {
try {
// merging the FDF file
PdfReader pdfreader = new PdfReader("SimpleRegistrationForm.pdf");
PdfStamper stamp = new PdfStamper(pdfreader, new FileOutputStream("registered_xfdf.pdf"));
XfdfReader fdfreader = new XfdfReader("register.xfdf");
AcroFields form = stamp.getAcroFields();
form.setFields(fdfreader);
stamp.close();
}
catch (Exception e) {