File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes IText PDF Encryptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "IText PDF Encryptor" Watch "IText PDF Encryptor" New topic
Author

IText PDF Encryptor

Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
My application runs on java 1.5. I use iText 5.0.2 libraries to create and encrypt data into a pdf file. But, while encrypting using the method PdfEncryptor.encrypt(),
I get the error :
java.lang.UnsupportedClassVersionError: Bad version number in .class file


It is working fine on java 1.6. The iText site says, It supports java 1.5. My application is supposed to run on a server which uses java 1.5. So, will have to stick on to 1.5.
can anyone help me with a solution?
Thanks in advance..!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
Post the entire error message (which tells us which class has a bad version number).


Ping & DNS - my free Android networking tools app
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 79
Problem solved..!javascript:emoticon('');

Anyway, I am stating the problem and the description.
My problem is actually with Java Versioning. I had explained about it in the current post and my earlier post:

http://www.coderanch.com/t/500586/java/java/Java-versioning

I was getting the above error because, even though my system was using java 1.5, since i used java 1.6 to compile my application earlier (i guess..!), a file at the location namely,
src -> Libraries -> Web App Libraries/bcprov-jdk16-145.jar
supports JDK 1.6 and not java 1.5.
You can learn about the file from the site
http://www.bouncycastle.org/latest_releases.html


I replaced it with another file, bcprov-jdk15-143.jar which is for Java 1.5 and the problem is solved..!
Thank you very much Ulf, for the time and concern.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: IText PDF Encryptor