I have a pdf form that is enabled for Adobe Reader functionality becuase i
want people be able to fill out the form and email it back even if they only
have Adobe Reader. I take a pdf template copy the file and prefill the form
fields and attach the new pdf to an email. When O open the attachment from
the email useing Reader the form fields are missing it will be correct int
Acorbat Pro but not in Reader I get a message that the file has been edited
and the Reader functionality is no longer available. How can I create the
for so the users can fill it out and email back?
Thank you below is the code i am using to create the files
/* copying the file to the drive */
File fileIn = new File(formDirectory+"/"+
pdfFormName);
File fileOut = new File(emailAttachmentDirectory
+"/ContactInfo_"+ theOrganization.getId() +".pdf");
FileCopyUtils.copy(fileIn, fileOut);
InputStream itStrm = new FileInputStream(fileOut);
PdfReader readerNewFile = new PdfReader(itStrm);
FileOutputStream fileOutStream = new
FileOutputStream(fileOut);
ByteArrayOutputStream theNewFile2 = new
ByteArrayOutputStream();
PdfStamper stamper = new PdfStamper(readerNewFile,
fileOutStream);
AcroFields formFields = stamper.getAcroFields();
//fill the pdf's organization info fields
fillOrg(formFields, theOrganization);
// get the contacts for this organization
List<Contact> contacts =
contactDao.searchContactForOrg(theOrganization.getId());
//fill the pdf's organization info fields
fillOrg(formFields, theOrganization);
// fill the pdf's contacts info fields
int counter = 0;
for (Contact theContact : contacts) {
counter++;
fillContact(formFields, theContact, counter);
}
stamper.close();
/* copying the file to the drive */
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
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