Post the PDF.
Paulo
-----Original Message-----
From: Peter Macko [mailto:[email protected]]
Sent: Sunday, March 21, 2010 9:27 PM
To: [email protected]
Subject: [iText-questions] Secure pdf problem
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: [email protected]
ICQ: 235778849
------------------------------------------------------------------------------
Download Intel® 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
[email protected]
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/
Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
informação confidencial ou legalmente protegida. A incorrecta transmissão desta
mensagem não significa a perca de confidencialidade. Se esta mensagem for
recebida por engano, por favor envie-a de volta para o remetente e apague-a do
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de
usar, revelar ou distribuir qualquer parte desta mensagem.
Disclaimer:
This message is destined exclusively to the intended receiver. It may contain
confidential or legally protected information. The incorrect transmission of
this message does not mean the loss of its confidentiality. If this message is
received by mistake, please send it back to the sender and delete it from your
system immediately. It is forbidden to any person who is not the intended
receiver to use, distribute or copy any part of this message.
------------------------------------------------------------------------------
Download Intel® 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
[email protected]
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/