Q1) That was discussed previously and is a limitation/feature of the PDF format. Even Acrobat can't do it.
Q2) PdfReader.isEncrypted() ----- Original Message ----- From: "Wahaj" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Tuesday, March 22, 2005 6:27 AM Subject: [iText-questions] Signing & Encrypting Hi Guys, I have been playing with iText signing and encryption functionality for some time and below are my obervations using iText-50 a.. For multiple signings to work the last parameter MUST be set to true other wise signing again will corrupt the previous signatures. PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0', new java.io.File("temp1"), true); a.. For Sign & Encrypting a PDF that parameter MUST be set to 'false', other wise an exception will come i.e. com.lowagie.text.DocumentException: Append mode does not support encryption. at com.lowagie.text.pdf.PdfStamper.setEncryption(PdfStamper.java:302) at com.lowagie.text.pdf.PdfStamper.setEncryption(PdfStamper.java:322) PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0', new java.io.File("temp1"), false); a.. While signing and encrypting using the 'false' parameter as above the previous signature if present gets corrupted. A more detailed result is as follows: PDF document state Action to Perform Are Previous signatures get corrupted ? ------------------------------------------------------------------------ ----------------------------------------------------------------- Sign&Enc Sign YES Sign Sign&Enc YES Enc Sign&Enc No Enc Sign No Q1) Can we do some thing to change YES to No in the above table ? Q2) Also is there an easy way to figure out whether a PDF document is already encrypted without catching certain exceptions ? Regards, Wahaj ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
