I' trying to print a newreceipt from a template receipt with values taken
input from the java application.
Code is just creating a newreceipt.pdf but the fields are not being filled
*Code:* void ReplacePdfForm()
{
String fileNameExisting =
"C:\\Users\\arun\\Desktop\\receipt_form.pdf";
String fileNameNew =
"C:\\Users\\arun\\Desktop\\receipt_form_new.pdf";
try{
FileInputStream existingFileStream = new
FileInputStream(fileNameExisting);
FileOutputStream newFileStream = new
FileOutputStream(fileNameNew);
reader = new PdfReader(existingFileStream);
stamper = new PdfStamper(reader,newFileStream);
AcroFields form = stamper.getAcroFields();
form.setField("Name","new name");
form.setField("loanid","new loanid");
form.setField("date","new date");
form.setField("amtpaid","123123");
stamper.setFormFlattening(true);
stamper.close();
reader.close();
JOptionPane.showMessageDialog(null,"done",
"done",JOptionPane.INFORMATION_MESSAGE);
}
catch(Exception e){
JOptionPane.showMessageDialog(null,e.getMessage(),"asd",JOptionPane.ERROR_MESSAGE);
}
}
I created the original template form with openoffice
The above fields were created of type text fields and were given the names
as Name,loanid,date,amtpaid.
The output Im getting is a flattened form with none of it's fields filled.
Thanks in advance for help
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php