Hi I’m using Itext to read a form PDF, and then populate it with data before writing it to the response output in a JSP page. I’m using adobe reader version7, and although the form is not password protected or encrypted I receive a warning which hints at some form of encryption. The following code snippet is used, note that I’m using the fully qualified url address as using the relative address results in a file not found exception
PdfReader reader = new PdfReader("http://10.100.100.113:8989/IBroker/loan-documents/home-improvements/applicationformFDF.pdf");
response.setContentType("application/vnd.pdf");
PdfStamper stamp1 = new PdfStamper(reader, response.getOutputStream());
AcroFields form1 = stamp1.getAcroFields();
form1.setField("lscprsurnm", "MAY");
stamp1.close();
The error produced is:
java.io.IOException: Unknown encryption type (4)
at com.lowagie.text.pdf.PdfReader.readDecryptedDocObj(Unknown Source)
at com.lowagie.text.pdf.PdfReader.readDocObj(Unknown Source)
at com.lowagie.text.pdf.PdfReader.readPdf(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
at com.lowagie.text.pdf.PdfReader.<init>(Unknown Source)
Any help would be appreciated as this is driving me up the wall. I did orgionaly try the Adobe FDF toolkit but that failed as well by hanging with an Adobe “File i/io error”.
Sincerely Paul
IT Services
London Scottish Bank plc
24 Mount Street
Manchester M2 3LS
Email: paul.may@london-scottish.com
Phone: 07767324734
Ext: : 01618302354