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?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
you can do it with iText PDF for java:
some examples:
http://1t3xt.info/examples/browse/?page=example&id=42
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.
You can easily make the Password protected pdf file in java......to do so you will require two addtional jar/lib bctsp-jdk16-1.46.jar and bcprov-jdk16-1.46.jar along with the itextpdf-5.2.1.jar.
Download all jars from here Download Jars
Also below is the snippet of the code
FOP library also allows encryption:
http://xmlgraphics.apache.org/fop/0.94/pdfencryption.html