Hi viralpatel,i tried the example but i got the Following Error at RunTime Also the next argument is permission you want to give to user. We passed Hello123 and Owner123 as password values. First two parameters are the password values in bytes. Note that in setEncryption() method, we passes several arguments. Just added one line tEncryption() to set password to generated PDF. Thus we used the same steps to generate PDF file that we used in previous tutorial. PdfWriter.ALLOW_PRINTING, PdfWriter.ENCRYPTION_AES_128) ĭocument.add( new Paragraph( "Hello World, iText")) ĭocument.add( new Paragraph( new Date().toString())) tEncryption(USER_PASS.getBytes(), OWNER_PASS.getBytes(), PdfWriter writer = PdfWriter.getInstance(document, file) OutputStream file = new FileOutputStream( new File( "D:\\Test.pdf")) Private static String OWNER_PASS = "Owner123" Private static String USER_PASS = "Hello123"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |