Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] PDF Unknown encryption type (4)

May, Paul

2005-06-14


PDF Unknown encryption type (4)

Hi Im using Itext to read a form PDF, and then populate it with data before writing it to the response output in a JSP page. Im 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 Im 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


Paul May

IT Services

London Scottish Bank plc

24 Mount Street

Manchester M2 3LS

Email: paul.may@london-scottish.com

Phone: 07767324734

Ext: : 01618302354


*** Disclaimer ***

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@London-Scottish.com as soon as possible and delete the message from all places in your computer where it is stored.

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
©2008 junlu.com - Jax Systems, LLC, U.S.A.