I just created a standalone App using this code. As JDK i used 1.4.2_12.
The "TestEncrypted.pdf" is created but no user password set! :(
/import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfStamper;
import com.lowagie.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-tp3677768p3677959.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
[email protected]
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