Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help wanted: password protect a document

 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic