Hi,

As you can see, on the bottom of the webpage:
www.itextpdf.com
you also need the <http://www.bouncycastle.org/>BouncyCastle
bcmail-jdk16-145.jar and bctsp-jdk16-145.jar.

Well, I am a beginner at iText, but I hope this helps.


At 02:27 PM 03/21/10, Peter Macko wrote:
Hello
I trying to use your iText 5.0.0.1 java Library for Secured my PDFs. I tried this example:

PdfEncryptor.encrypt(new PdfReader("/home/pmacko/PDF/DBS.pdf"), new FileOutputStream("/home/pmacko/PDF/DBS2.pdf"),
                                  "Hello".getBytes(), "World".getBytes(),
                                  PdfWriter.AllowDegradedPrinting,
                                  PdfWriter.STRENGTH128BITS);

But it gives me this error:

Exception in thread "main" java.lang.ClassCastException: com.itextpdf.text.pdf.PdfDictionary cannot be cast to com.itextpdf.text.pdf.PRIndirectReference
        at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:209)
        at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:189)
        at com.itextpdf.text.pdf.PdfEncryptor.encrypt(PdfEncryptor.java:79)
        at sk.stuba.fiit.pmacko.pdfLocker.PDFLocker.main(PDFLocker.java:24)

I using Bouncy Castle (bcprov-jdk16-145.jar) library too. Can you help me pls?

--
Peter Macko
Mail: pma...@pcrevue.sk
ICQ: 235778849

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to