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

Free Support Forum - aspose.com

Converting tp PDF/a failed without error

Hi,

currently I am converting documents into PDF/a Files. In some cases we see no errors being thrown despite the conversion failing. The following shows this.

<Compliance Name="Log" Operation="Validation" Target="PDF/A-2B">
   <Version>1.0</Version>
   <Copyright>Copyright (c) 2001-2019 Aspose Pty Ltd. All Rights Reserved.</Copyright>
   <Date>03.08.2021 08:35:15</Date>
   <File Version="1,5" Name="" Pages="73">
    <Security />
    <Catalog />
    <Problem Severity="Error" Clause="Annex" ObjectID="347" Convertable="True">Object is compressed</Problem>
    <Problem Severity="Error" Clause="Annex" ObjectID="880" Convertable="True">Object is compressed</Problem>
    <Problem Severity="Error" Clause="Annex" ObjectID="1392" Convertable="True">Object is compressed</Problem>
    <Problem Severity="Error" Clause="Annex" ObjectID="1914" Convertable="True">Object is compressed</Problem>
    <Problem Severity="Error" Clause="Annex" Convertable="True">The xref stream is prohibited</Problem>
    <Header />
    <Annotations />
    <Fonts>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="5" Page="1" Convertable="True">Font 'Times New Roman' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="7" Page="1" Convertable="True">Font 'Times New Roman,Bold' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="103" Page="5" Convertable="True">Font 'Times New Roman,Italic' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="130" Page="10" Convertable="True">Font 'Times New Roman' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="133" Page="10" Convertable="True">Font 'Symbol' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="154" Page="13" Convertable="True">Font 'Arial,Bold' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="156" Page="13" Convertable="True">Font 'Arial' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="238" Page="39" Convertable="True">Font 'Times New Roman,BoldItalic' is not embedded</Problem>
      <Problem Severity="Error" Clause="6.3.4" ObjectID="255" Page="52" Convertable="True">Font 'Helvetica' is not embedded</Problem>
      <Problem Severity="Error" Clause="" ObjectID="133" Page="10" Convertable="True">Width information for glyphs is inconsistent in embedded font 'Symbol'</Problem>
      <Problem Severity="Error" Clause="6.3" ObjectID="170" Page="16" Convertable="True">Font "Cambria Math" contains table "MATH" which can't be used in this PDF format</Problem>
    </Fonts>
    <trailer />
    <Metadata>
      <Problem Severity="Error" Clause="6.7.11" Convertable="True">Required property 'pdfaid:part' for schema 'pdfaid' missing</Problem>
      <Problem Severity="Error" Clause="6.7.11" Convertable="True">Required property 'pdfaid:conformance' for schema 'pdfaid' missing</Problem>
    </Metadata>
    <objects />
   <xObjects />
    <actions />
  </File>
</Compliance>

This occurs trying to convert the following files:
MOD06-ATBD_2015_05_01_1.pdf
MOD06-ATBD_2015_05_01_1.pdf (3.2 MB)

This is an open source PDF file from https://catalog.data.gov/dataset

Our code:

var options = new PdfFormatConversionOptions(PdfFormat.PDF_A_2B);
options.ConvertSoftMaskAction = ConvertSoftMaskAction.ConvertToStencilMask;
options.ExcludeFontsStrategy = PdfFormatConversionOptions.RemoveFontsStrategy.SubsetFonts |     PdfFormatConversionOptions.RemoveFontsStrategy.RemoveDuplicatedFonts;
options.ErrorAction = ConvertErrorAction.None;
options.OptimizeFileSize = true;

byte[] pdfDoc;
convertDoc.Flatten();
using (var memoryStream = new MemoryStream())
{
    options.LogStream = memoryStream;
    convertDoc.Validate(options);
    // CheckErrors(memoryStream);
}

using (var memoryStream = new MemoryStream())
{
    options.LogStream = memoryStream;
    convertDoc.Convert(options);
    // CheckErrors(memoryStream);
}

using (var strmOut = new MemoryStream())
{
    convertDoc.Save(strmOut);
    pdfDoc = strmOut.ToArray();
}

I would appreciate any help on the matter.

@Verus2020

I have been able to reproduce the issue on our end. A ticket with ID PDFNET-50331 has been created in our issue tracking system to further investigate the issue on our end. This thread has been linked with the issue so that you may be notified once the issue will be fixed.