When using iText 5.1 with JDK 1.6.0_26 and this code it works just great... I am totally lost now ... :(((
/import java.io.FileOutputStream; import java.io.IOException; import com.itextpdf.text.DocumentException; import com.itextpdf.text.pdf.PdfReader; import com.itextpdf.text.pdf.PdfStamper; import com.itextpdf.text.pdf.PdfWriter; public class EncryptionPdf { public static void main(String[] args) throws IOException, DocumentException { PdfReader reader = new PdfReader("Test.pdf"); PdfStamper stamper = new PdfStamper(reader, new FileOutputStream("TestEncrypted.pdf")); byte[] upwd= "test".getBytes(); byte[] opwd = "test2".getBytes(); stamper.setEncryption(upwd, opwd, PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128 | PdfWriter.DO_NOT_ENCRYPT_METADATA); stamper.close(); } }/ -- View this message in context: http://itext-general.2136553.n4.nabble.com/PDF-encryption-as-a-Web-Service-on-a-JDK-1-4-based-Application-Server-tp3677768p3677978.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php