Conversion to PDFA issue


#1

I’m using Aspose.PDF to convert PDF file into PDF/A.
But its showing error in generated log file and failed to convert.
code :
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Pdf.lic”);
string dataDir = “C:/Users/hp/Documents/”;
Document pdfDocument = new Document(dataDir + “InvoiceTemplateSPDM_20181206130112032.pdf”);
pdfDocument.Convert(dataDir + “log.xml”, PdfFormat.PDF_A_3A, ConvertErrorAction.None);
dataDir = dataDir + “PDFToPDFA_out1.pdf”;
pdfDocument.Save(dataDir);
Close();

Source File:
InvoiceTemplateSPDM_20181206130112032.pdf (122.9 KB)

OutPut file:
PDFToPDFA_out1.pdf (213.3 KB)

Log File result:

<?xml version="1.0"?>

-

1.0

Copyright © 2001-2012 Aspose Pty Ltd. All Rights Reserved.

06-12-2018 18:35:23

-

-

The transparency is prohibited (‘Group’ key)

The transparency is prohibited (‘Group’ key)

-

Width information for glyphs is inconsistent in embedded font ‘QPNGIN+Calibri’

Width information for glyphs is inconsistent in embedded font ‘PORYUK+Calibri,Bold’

Width information for glyphs is inconsistent in embedded font ‘MFWCLU+TimesNewRoman,Bold’

Width information for glyphs is inconsistent in embedded font ‘RJYQFE+TimesNewRoman’

Catalog shall have struct tree root entry

Catalog shall have MarkInfo entry


#2

@Hiral201092

Thanks for contacting support.

We have tested the scenario using Aspose.PDF for .NET 18.12 and were unable to notice any issue. The output PDF file passed the validation test without any error. For your kind reference, an output PDF and Validation Test results are attached.

result_pdfa.pdf (205.6 KB)
2018-12-06_23-03-05.png (12.8 KB)

Would you please try the scenario with latest version of the API and in case you still face any issue, please feel free to let us know.


#4

Thank You for your quick repose.

Earlier i was using version 17.6.0.0 and after your reply i have downloaded the latest version 18.12.0.0 which is release a day before.

but still facing the same issue.

this is the file which converted via version 18.12.0.0
PDFToPDFA_Ver1812.pdf (204.6 KB)


#5

@Hiral201092

Thanks for your feedback.

Please use following code snippet in your environment and in case you still face any issue, please let us know.

Document pdfDocument = new Document(dataDir + "InvoiceTemplateSPDM_20181206130112032.pdf");
// Convert 
pdfDocument.Convert(new MemoryStream(), PdfFormat.PDF_A_3A, ConvertErrorAction.Delete);
// Save output document
pdfDocument.Save(dataDir + "result_pdfa.pdf"); 

#6

Thanks for your help!!

its working now.

but i have a doubt why its not working with log files?
pdfDocument.Convert(dataDir + “log.xml”, PdfFormat.PDF_A_3A, ConvertErrorAction.None);


#7

@Hiral201092

Thanks for your feedback.

The problem was not related to log file or stream but with second parameter of ConverErrorAction.None. With ConverErrorAction.None, those parts of PDF which can not be converted into PDF/A are left unchanged that is why document will not be PDF/A-compatible. ConvertErrorAction.Delete makes API to delete incompatible content/parts of the document resulting valid output will be generated.