Hello,
we are using Aspose.PDF for Java 25.5 to merge PDF/A-2a compliant PDF documents into a single PDF/A-2a document.
During the conversion I get this error while converting to PDF/A-2a the merged document.
class com.aspose.pdf.internal.ms.System.l5v: String was not recognized as a valid DateTime.
com.aspose.pdf.internal.ms.System.l3t.lI(Unknown Source)
com.aspose.pdf.internal.ms.System.l3t.lI(Unknown Source)
com.aspose.pdf.internal.ms.System.l3t.lf(Unknown Source)
com.aspose.pdf.internal.ms.System.l2j.l0if(Unknown Source)
com.aspose.pdf.internal.l9f.lt.lf(Unknown Source)
com.aspose.pdf.internal.l9f.lt.lI(Unknown Source)
com.aspose.pdf.internal.l9f.l2t.lI(Unknown Source)
com.aspose.pdf.internal.l9f.lt.lI(Unknown Source)
com.aspose.pdf.internal.l9f.lt.lf(Unknown Source)
com.aspose.pdf.internal.l9k.l0f.l5f(Unknown Source)
com.aspose.pdf.internal.l9k.l0f.l3n(Unknown Source)
com.aspose.pdf.internal.l9k.l1l.l5v(Unknown Source)
com.aspose.pdf.internal.l9k.l0f.lI(Unknown Source)
com.aspose.pdf.ADocument.lI(Unknown Source)
com.aspose.pdf.ADocument.convert(Unknown Source)
com.aspose.pdf.Document.convert(Unknown Source)
Here’s a sample code to reproduce the problem (in attach example files)
TEST_merge_pdfa-2a.zip (82.6 KB)
public static void main(String[] args)
{
try
{
initLicense();
testPdfMerge(new String[] { "C:\\test\\doc\\pdf\\merge\\pdfa-2a\\TEST_testo_PDFA-2a.pdf", "C:\\test\\doc\\pdf\\merge\\pdfa-2a\\Allegato1.pdf" }, "C:\\test\\doc\\pdf\\merge\\pdfa-2a\\test-merged.pdf");
}
catch (Exception e)
{
e.printStackTrace();
}
}
private static void testPdfMerge(String[] inputFiles, String outFile)
{
Document mergedPdfDocument = new Document(inputFiles[0]);
System.out.println("processing: "+inputFiles[0]);
for (int i=1; i<inputFiles.length; i++)
{
// Open the source document
Document pdfDocument = new Document(inputFiles[i]);
System.out.println("processing: "+inputFiles[i]);
PageCollection pages = pdfDocument.getPages();
// Add the pages of the source document to the target document
for (int n=1; n<=pages.size(); n++)
{
Page page = pages.get_Item(n);
// appendo la pagina al documento finale
mergedPdfDocument.getPages().add(page);
}
}
PdfFormat conformanceLevel = PdfFormat.PDF_A_2A;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// Convert document and save errors into the specified stream.
PdfFormatConversionOptions options = new PdfFormatConversionOptions(baos, conformanceLevel, ConvertErrorAction.Delete);
options.setAutoTaggingSettings(AutoTaggingSettings.getDefault());
mergedPdfDocument.convert(options);
mergedPdfDocument.save(outFile);
mergedPdfDocument.close();
System.out.println("written output file: "+outFile);
}
The problem can be reproduced with different documents.
The source documents are PDF/A-2 compliant with WCAG 2.1.
Please help us to solve this problem.
@fabio.parise
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFJAVA-45132
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you.
I hope that is given the right priority to this issue as it is blocking for us.
Accessibility in PDF production is becoming a very important issue for all public sector institutions as the European Accessibility Act comes into force in Europe in June 2025.
The European Accessibility Act will come into effect on 28 June 2025. Failing to comply with the law could result in penalties including fines for European public-sector organisations.
Can you confirm that the above code is the right way to merge accessible PDFs and get an accessible PDF in PDF/A-2a format?
@fabio.parise
Yes, the code snippet looks fine. Furthermore, we will analyze the ticket for improvements as well. The issue will be prioritized on first come first serve basis as per the free support policies and as soon as we have some news about its fix, we will inform you via this forum thread. Please be patient and spare us some time.
We are sorry for the inconvenience.
Same error occurs when invoking method getTaggedContent() before convert() as shows in this code:
PdfFormat format = PdfFormat.PDF_A_2A;
Document pdfDocument = new Document(inFile.getPath());
if (PdfFormat.PDF_A_2A.equals(format))
{
// Get Content for work with TaggedPdf
ITaggedContent taggedContent = pdfDocument.getTaggedContent();
// Imposta la lingua principale del documento (es. "it-IT" per italiano)
//taggedContent.setLanguage("it-IT");
// Imposta il flag DisplayDocTitle
pdfDocument.setDisplayDocTitle(true);
}
pdfDocument.convert(logFos, format, ConvertErrorAction.Delete);
Can you give a workaround for this blocking problem?
@fabio.parise
Thanks for sharing further details. We are afraid that we cannot provide any workaround at the moment because the ticket hasn’t been investigated yet. As soon as we make some progress towards its investigation, we will inform you via this forum thread. Please be patient and spare us some time.
We are sorry for the inconvenience.
Hello! Update about the resolution of this issue?
@fabio.parise
We regret to inform you that the issue remains unresolved at this time. Rest assured, we will promptly update this forum thread as soon as we have any progress on the ticket resolution. We kindly ask for your patience while we work on this matter.
We sincerely apologize for any inconvenience this may have caused.
Hello. I noticed that in version 25.8 of Aspose.PDF for Java has been resolved the following issue, that reports the same error, but only for the PDF/A-1a conversion.
PDFJAVA-45131
PDF to PDF/A-1a with setAutoTaggingSettings() throws String was not recognized as a valid DateTime
I tested that the error persists for PDF/A-2a conversion.
Why this issue is still in status OPEN while an identical error has been fixed for PDF/A-1a?
@fabio.parise
Please note that sometimes issues are related to specific PDF documents and they are resolved only for that files. Even two identical PDF documents can be different in terms of their structures and complexity. Nevertheless, the ticket was logged for your specific file(s) and will be resolved for them as soon as the investigation is complete. We will surely inform you once we have some updates in this regard. Please spare us some time.
We are sorry for the inconvenience.