PdfWriter writer = PdfWriter.getInstance(document,new
FileOutputStream("d:\\HelloEncrypted.pdf"));
writer.setEncryption("Hello".getBytes(), "Hello".getBytes(),
PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING,
PdfWriter.STANDARD_ENCRYPTION_128);             
document.open();
document.add(new Paragraph("***Hello World***"));


Here the, HelloEncrypted.pdf contains Hello World text.This pdf is protected
with passwords Hello.
The Hello World text is displaying while opening using the password Hello.

I am enhancing my API, I completed the password protection for PDF file but
the contents in the PDF is not displaying.

The contents are Deflated and displayed as expected without Encrypt in
trailer.

The contents in the PDF are displayed when Encrypt is removed from
trailer,but when i included the Encrypt in trailer and modified the size in
trailer , the PDF is promting for password and opened but no contents are
displayed.


What I missed regarding the contents and password encrypt?why the contents
are displayed though the correct password is give?what is the relation
between the password encryption and the text/string available in PDF file?

Pls help me by providing source or explanation for the source code in itext.
http://www.nabble.com/file/p25530605/HelloEncrypted.pdf HelloEncrypted.pdf 
-- 
View this message in context: 
http://www.nabble.com/Pdf-Encryption-tp25530605p25530605.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to