We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert PDF to PDFA in Java using Aspose.PDF in JRE 1.5 Environment

I have a requirement where I need to convert existing PDF files into PDF/A-1b. I’m using jre1.5 in my project so is there a way I can achieve my requirement ? I need a compatible Aspose-pdf jar with my JRE version. Please suggest some options.

Hi,

Thank you for contacting support. You can convert the existing PDF documents to PDF/A-1B and Aspose.Pdf for Java API supports JRE 1.6 or higher versions. Kindly upgrade JRE version in your project and try the latest version 17.5 of Aspose.Pdf for Java API. Please refer to this help topic: Convert PDF file to PDF/A-1b

Please let us know in case of any further assistance or questions.

But JRE up-gradation is not possible for the moment. Is there no way to achieve it in JRE 1.5?

Hi,

Thank you for the inquiry. We officially do not support JRE 1.5 and recommend our clients use JRE 1.6 or higher versions. Furthermore, we have tried the latest version 17.5 of Aspose.Pdf for Java API with JRE 1.5 and it works fine in our environment.

Hello,
I seem to be getting the following error while running my project.

Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Hi,

Thank you for the details. We managed to replicate this error in our environment. The support for JDK 1.5 has been dropped by Oracle so it is not supported by Aspose APIs as well. We are sorry to share that you will not be able to get JDK 1.5 compatible JARs in the latest versions of Aspose APIs. You can use an old version of Aspose.Pdf for Java API, all versions before 10.0.0 include these JARs.

Thanks & Regards
Imran Rafique

Will I be able to convert PDF into PDF/A-1b using API before 10.0.0 jars? Can you provide me with the appropriate jar because I’m not able to locate anything online?

Hi,

Thank you for the inquiry. Yes, you can convert the PDF document to PDF/A-1b using an old version 9.7.1 (help topic: PDF to PDF/A_1b Conversion). Please refer to the download of an old version 9.7.1 of Aspose.Pdf for Java API: Download Aspose.Pdf for Java 9.7.1. There are two Jars, one (aspose-pdf-x.x-jdk14.jar) for Jdk 1.4 or higher versions, and the second (aspose-pdf-x.x-jdk16.jar) for Jdk 1.6 or higher versions.

Thanks & Regards,
Imran Rafique

Hello,

Thank you so much for your help. I was able to convert my PDF into PDF/A successfully. Though when I validated the generated PDF/A using online tools, I was getting some errors like:

“The XMP property ‘pdf:Keywords’ is not synchronized with the document information entry ‘Keywords’.
The value of the key N is 4 but must be 3.
The key Type is required but missing.
The key Type is required but missing.
The document does not conform to the requested standard.
The document doesn’t conform to the PDF reference (missing required entries, wrong value types, etc.).
The document’s meta data is either missing or inconsistent or corrupt.”

I know this is not because of some issue with Jar. Can you please tell me if Aspose API contains methods that can fix these errors?

Hi Imran,

Please ignore the errors from my previous post. These are the errors which I’m getting for my PDF:

The value of the key N is 4 but must be 3.
The document does not conform to the requested standard.
The document doesn’t conform to the PDF reference (missing required entries, wrong value types, etc.).

Can you please provide some solution?

Hi,

Thanks for sharing the details.

Aspose.Pdf for Java is built according to the specifications of Adobe and in order to validate the PDF/A compliance, we recommend using Adobe Pre-flight. There are numerous online third party tools for compliance verification but all of them have their own specifications and I am afraid it would be difficult to update our API as per their standards.

Can you please try using Adobe pre-flight and share your findings. In case the issue still persists, please share your input PDF file, so that we can test the scenario in our environment. We are sorry for this inconvenience.