aspose file tools*
The moose likes Security and the fly likes Help wanted: password protect a document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "Help wanted: password protect a document" Watch "Help wanted: password protect a document" New topic
Author

Help wanted: password protect a document

vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
Hi, I need help on how to add password to my PDF file.

Please guide me on what API I should use.

I have previously use iText but somehow I'm getting this error below, therefore I want to try an alternative method:


Thank you very much! Please point me to alternate methods or enlighten me about the exception above, thanks again!


I'm not available, my BF's name is WORK.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
The iText tutorial has a couple of examples about encryption, and in general this works without problems.

Can you work with that file in other ways, e.g. add a watermark, so that it's clear that iText can handle the file in general?


Ping & DNS - updated with new look and Ping home screen widget
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
Hi Ulf,
I tried it with other PDF files and they run fine.
The exception is caused by not adding "%%EOF" to the trailer, which I don't know how to do it.
anyway thanks, I switched to use SecurSign to encrypt my PDFs instead. Can you possibly take a look what is wrong with my code in another thread?

Signing PDF with SecurSign
 
 
subject: Help wanted: password protect a document
 
Similar Threads
install4j Exception error
Loading java applet from a cab file failed
Error
Page Count in PDF document
Need help on resolving java.io.IOException: trailer not found.