Hi,
I am using i-Text to read a PDF Form, populate the fields and flatten it before displaying the resultant PDF in the browser. The code is as follows:
String urlString = "http://localhost:8080/fdfsample/PDFs/FormTest.pdf";
resp.setContentType(
"application/vnd.fdf"); PdfReader reader = new PdfReader(new URL(urlString.toString()));System.out.println(
"number of pages in pdf : " + reader.getNumberOfPages());AcroFields afields = reader.getAcroFields();
HashMap fieldsHM = afields.getFields();
System.out.println(
"number of fields : " + fieldsHM.size());afields.setField(
"txtFirstName","FirstName");I am getting the error as below on the line where the field "txtFirstName" is being set:
[2/16/04 17:25:30:914 PST] 6a609e03 WebGroup E SRVE0026E: [Servlet Error]-[FDFServlet]: com.lowagie.text.DocumentException: This AcroFields instance is read-only.
at com.lowagie.text.pdf.AcroFields.setField(Unknown Source)
Can anyone help me to figure out the error I am making.
Thanks in advance for your help.
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online