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
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: 41508
    
  53
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 - my free Android networking tools app
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help wanted: password protect a document