Hi
Actually I have XFA form which are designed in Adobe designer 7.0 and these pdf
are enabled with Adobe LiveCycle Reader extension, therfore user can can fill,
sign and save information on this pdf for Adobe Reader.
Now I want to used iText for getting data into this pdf to be filled
automatically from the database and produce thousands of pdfs.
I have also prepared the test code to do this stuff (taken help from Paulo), to
check whether I can do this stuff.
The problem now I m facing is, when I fill the data into this pdf, the
resulting pdf is showing the error : "This document contained certain rights to
enable special features in adobe reader.The document has been changed since it
was created and these right are no longer valid" before opening and the pdf
has lost its original features like now I cannot enter the the data anymore in
the fields which are left vacant for other employees to fill in and even the
other buttons like drop down buttons have gone, they no more visible.
The code is as follows:
String key;
Document document = new Document();
PdfReader reader = new
PdfReader("C://src//EditPdf//IPC-1752-1_v1.04564.pdf");
try {
PdfCopy copy = new PdfCopy(document, new
FileOutputStream("C://src//EditPdf//IPC-1752-1_v1.04564.pdf"));
PdfStamper stamp = new PdfStamper(reader,new FileOutputStream(
"C://stamped.pdf"));
AcroFields form = stamp.getAcroFields();
//AcroFields form = reader.getAcroFields();
HashMap fields = form.getFields();
for (Iterator i = fields.keySet().iterator(); i.hasNext(); ) {
key = (String) i.next();
System.out.println(key);
}
//set the field values in the pdf form
form.setField("MCD[0].RoHSpage1[0].RequestInformation[0].RequestContactName[0]",
"Rahul Gupta");
stamp.setFormFlattening(true);
stamp.close();}
catch(Exception e) {
System.out.println("Error: " + e);
}
}
Thanks,
Rahul
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions