• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help wanted: password protect a document

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Yes, of course, and I accept that blame. In fact, i covet that blame. As does this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic