views:

321

answers:

3

we have a requirement to protect pdf files using a password, are there any java based open source tools which will help us in this regard?

A: 

you can do it with iText PDF for java:

some examples:

http://1t3xt.info/examples/browse/?page=example&id=42

jspcal
iTextSharp is the .NET version :) I think you meant iText itextpdf.com :)
scott
+2  A: 

I would recommend using the iText java PDF library.

Inside iText, there is a class called PdfEncrypter which should let you password protect a PDF file.

David-Zazeski
I am unable to access this link and it seems to be down for quite some time
Joshua
If you're having trouble accessing the main iText website, you can also download the code from sourceforge:http://sourceforge.net/projects/itext/
David-Zazeski
A: 

FOP library also allows encryption:

http://xmlgraphics.apache.org/fop/0.94/pdfencryption.html

True Soft
Is that for existing PDF's or the one you are currently creating?
Thorbjørn Ravn Andersen
The example in the link is for the file that you are currently creating, and I think it works on other existing PDF's. Joshua didn't mention in what context he needs encryption.
True Soft