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

Free Support Forum - aspose.com

Convert PDF to PDF/A in Java using Aspose.PDF for Java - Specified argument was out of the range of valid values

Hi,

When I try to convert a PDF to PDF/A it is throwing the below error.

Exception in thread “main” class com.aspose.pdf.internal.ms.System.lv: Specified argument was out of the range of valid values.
Parameter name: Parameter name: index
com.aspose.pdf.internal.ms.System.Collections.Generic.l0t.get_Item(Unknown Source)
com.aspose.pdf.internal.l19t.l33l$lf.lI(Unknown Source)
com.aspose.pdf.internal.l19t.l28u.lf(Unknown Source)
com.aspose.pdf.internal.l9if.lk.lI(Unknown Source)
com.aspose.pdf.internal.l9if.l0if.lI(Unknown Source)
com.aspose.pdf.internal.l9if.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l9if.l0l.lI(Unknown Source)
com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
com.aspose.pdf.internal.l8k.ly.l0y(Unknown Source)
com.aspose.pdf.internal.l8k.ly.lf(Unknown Source)
com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source)
com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
com.aspose.pdf.ADocument.lI(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
com.centene.pdf.ConvertPDFToPDFAFormat.pdfTopdfA2aConversion(ConvertPDFToPDFAFormat.java:118)
com.centene.pdf.ConvertPDFToPDFAFormat.main(ConvertPDFToPDFAFormat.java:61)
at com.aspose.pdf.internal.ms.System.Collections.Generic.l0t.get_Item(Unknown Source)
at com.aspose.pdf.internal.l19t.l33l$lf.lI(Unknown Source)
at com.aspose.pdf.internal.l19t.l28u.lf(Unknown Source)
at com.aspose.pdf.internal.l9if.lk.lI(Unknown Source)
at com.aspose.pdf.internal.l9if.l0if.lI(Unknown Source)
at com.aspose.pdf.internal.l9if.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l9if.l0l.lI(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.l0y(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lf(Unknown Source)
at com.aspose.pdf.internal.l8k.l0if.l0l(Unknown Source)
at com.aspose.pdf.internal.l8k.ly.lI(Unknown Source)
at com.aspose.pdf.ADocument.lI(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)
at com.aspose.pdf.ADocument.convert(Unknown Source)
at com.aspose.pdf.Document.convert(Unknown Source)
at com.centene.pdf.ConvertPDFToPDFAFormat.pdfTopdfA2aConversion(ConvertPDFToPDFAFormat.java:118)
at com.centene.pdf.ConvertPDFToPDFAFormat.main(ConvertPDFToPDFAFormat.java:61)

The below is the code snippet

public static void pdfTopdfA3bConversion(String inputfilepath, String outputfilepath) {
// String myDir = “pathToDir”;
// Open document
Document doc = new Document(inputfilepath);
// Convert to PDF/A3 compliant document
doc.convert(“Conversion_log.xml”, PdfFormat.PDF_A_3B, ConvertErrorAction.Delete);
doc.validate(“Validation_log.xml”, PdfFormat.PDF_A_3B);
doc.optimizeResources();
doc.optimize();
// Save resultant document
doc.save(outputfilepath);
}

Cannot attach the PDF here since it has member data.

@venkatesh2382

Please share your document in a private message where only Aspose Staff will have its access. You can send a private message by clicking over username and pressing Blue Message Button.

@asad.ali sent you thru private message.

@venkatesh2382

We have been able to reproduce the issue in our environment and logged it as PDFJAVA-39600 in our issue management system for the sake of correction. We will check this issue in details and keep you posted with the status of its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-39600) have been fixed in Aspose.PDF for Java 21.8.