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

Free Support Forum - aspose.com

PDF to PDF-A Failed for documents with multiple fonts and colors

I am trying to convert a PDF document to PDF-A/1b and failed to do with the attached PDF file. Using the code bellow for this purpose:

public void convertToPdfArchive(byte[] a_byteArrInputDocument) throws Exception {
if (!ASC_Util.isNullOrEmptyString(m_objSettingVO.getPdfArchiveFormat())) {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ByteArrayInputStream bis = new ByteArrayInputStream(a_byteArrInputDocument);
com.aspose.pdf.Document obj_PDFDocument = new com.aspose.pdf.Document(bis);
obj_PDFDocument.convert(new ByteArrayOutputStream(),
getPdfArchiveFormat(m_objSettingVO.getPdfArchiveFormat()),
ConvertErrorAction.Delete);
obj_PDFDocument.save(bos);
bis.close();
bos.close();
m_byteArrOutputDocument = bos.toByteArray();
} else {
throw new Exception("PDF Archive format is missing: " + m_objSettingVO.getPdfArchiveFormat());
}
}

private int getPdfArchiveFormat(String a_strPdfArchiveFormat) {
int i_pdfArchiveFormat = -1;
if (ASC_ConversionConstants.PDF_A_1A.equalsIgnoreCase(a_strPdfArchiveFormat)) {
i_pdfArchiveFormat = PdfFormat.PDF_A_1A;
} else if (ASC_ConversionConstants.PDF_A_1B.equalsIgnoreCase(a_strPdfArchiveFormat)) {
i_pdfArchiveFormat = PdfFormat.PDF_A_1B;
} else if (ASC_ConversionConstants.PDF_A_2A.equalsIgnoreCase(a_strPdfArchiveFormat)) {
i_pdfArchiveFormat = PdfFormat.PDF_A_2A;
} else if (ASC_ConversionConstants.PDF_A_2B.equalsIgnoreCase(a_strPdfArchiveFormat)) {
i_pdfArchiveFormat = PdfFormat.PDF_A_2B;
} else if (ASC_ConversionConstants.PDF_A_2U.equalsIgnoreCase(a_strPdfArchiveFormat)) {
//i_pdfArchiveFormat = PdfFormat.PDF_A_2B;
} else if (ASC_ConversionConstants.PDF_A_3A.equalsIgnoreCase(a_strPdfArchiveFormat)) {
//i_pdfArchiveFormat = PdfFormat.PDF_A_3B;
} else if (ASC_ConversionConstants.PDF_A_3B.equalsIgnoreCase(a_strPdfArchiveFormat)) {
i_pdfArchiveFormat = PdfFormat.PDF_A_3B;
} else if (ASC_ConversionConstants.PDF_A_3U.equalsIgnoreCase(a_strPdfArchiveFormat)) {
//i_pdfArchiveFormat = PdfFormat.PDF_A_3B;
}
return i_pdfArchiveFormat;
}

Conversion failed and error report is attached. Aspose.PNG list the lib versions.
What is missing which causing the problem?

Hi Wahaj,

Thanks for your inquiry. I have tested your scenario with your shared document using Aspose.Pdf for Java 10.1.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWJAVA-34781 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

Please feel free to contact us for any further assistance.

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
Calibri;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA”>Best Regards

The issues you have found earlier (filed as PDFNEWJAVA-34781) have been fixed in Aspose.Pdf for Java 11.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.