I have a pdf which contain acrofields. When i do stamping of those field and make this pdf flattened, everything is working fine. I got the pdf and all the acrofields have proper value. Problem is when I am opening this stamped file, Acrobat opens it sucessfully but when i scrolled down to the 6 page where my acrofields are present, it displays Error popup with following msg:
A error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct this problem.
I am also sending the link of the pdfs(pdf with acrofields and stamped pdf) for which error is occuring.
pdf file without filling acrofield
Code used to stamp the pdf file :-
`
PdfReader reader = new PdfReader(location1);
Integer i=0;
PdfStamper stamper = new PdfStamper(reader,new FileOutputStream(location2));
AcroFields form2 = stamper.getAcroFields();
Set<String> fields2 = new HashSet(form2.getFields().keySet());
for(String s1 : fields2)
{
i = i+1;
form2.setField(s1, i.toString());
}
stamper.setFormFlattening(true);
stamper.close();`
Scenario when this error comes : 1) stamping using itext 2.0.8 ( both in program(where stamping is done in main method) and with web application)
2) stamping using itextpdf 5.4.1(error msg appears only when stamping flow is running in web application. but if i generated stamped pdf using program(with main method), no error msg appear).
Please help me out.