PDF_A_2B Compliant Errors

Hi,


Using Aspose.Pdf version 11.0.0

Converting the attached document to PDF A2B gives the following in the log file

1.0Copyright © 2001-2012 Aspose Pty Ltd. All Rights Reserved.7/1/2016 1:28:44 PMThe trailer dictionary does not contain 'ID’Metadata key does not exists

Code is calling the Convert Method on the pdf document object.
mergedDocument.Convert(@“c:\Log.xml”, PdfFormat.PDF_A_2B, ConvertErrorAction.Delete);

Is there anything else in addition to calling convert required (for example write code to embed fonts?) or the convert method does that behind the scenes?

Thanks in advance
Rahul

Hi Rahul,


Thanks for your inquiry. I am afraid there is no other options for embedding fonts, as per PDFA standards the conversion process by default embed the fonts. You may double check the availability of fonts used in PDF document on your host machine. If you are facing any issue then please share your source document here, we will look into it and will guide you accordingly.

Furthermore, I have checked PDFA2b compliance of your shared PDF document with Preflight tool of Adobe Acrobat and it is successfully verified.

Best Regards,

Hi,


Thanks for your reply.

I don’t have source document for the attachment that was uploaded before.

However, I created another document (in word) and saved as pdf. I then ran through the code to convert into pdf a2b compliant. As you quite rightly said, the document is converted and is compliant as per Acrobat X Pro Preflight.

However, I still see errors in the log file that is produced during the conversion which is what my concern is.

All the files (source file in docx, saved in pdf via word, converted pdfa2b compliant file and the log file) are attached.

Many thanks
Rahul

Hi Rahul,


Thanks for your feedback and sharing source documents. After initial investigation, I have logged an investigation ticket PDFNET-41129 in our issue tracking system for further investigation. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi Rahul,


Thanks for your patience. We have investigated your concern and would like to inform you that it is expected behavior. The conversion log consists errors details. After conversion please use doc.Validate(outLog, Aspose.Pdf.PdfFormat.PDF_A_1B), if the PDFA file validates successfully then this log does not contain any error.

Please feel free to contact us for any further assistance.

Best Regards,

Hi,


Thanks for your reply and clarification, however, I don’t get the expected results.

As per your advise, I call validate which returns false (log file with the errors attached) but the document still shows as compliant on Acrobat Pro X.

Can you please advise?

Regards
Rahul Mehta

Hi Rahul,

Thanks for your feedback. I have tested the scenario using Aspose.Pdf for .NET 11.9.0 and unable to notice any error detail in vladiate_log.xml file. I will appreciate it if you please test following code snippet with latest version of Aspose.Pdf for .NET and share the results.

Document doc = new Document("Test_RM.pdf");

doc.Convert("convert_Log.xml", PdfFormat.PDF_A_2B, ConvertErrorAction.Delete);

MemoryStream ms = new MemoryStream();

doc.Save(ms);

doc = new Document(ms);

doc.Validate("validate_Log.xml", PdfFormat.PDF_A_2B);

doc.Save("PDFtoPDFA2b.pdf");

Best Regards,

Hi,


Thanks again and appreciate your prompt response.

The trick appears to be saving the document and then creating a new instance of it before validating it. This validates the document successfully and I get the desired result i.e. validate returns true and there is no error in the log file.

If, however, I call validate straight after convert I get a failure in validation. It seems that the document changes are not committed internally after calling convert. By calling the Save on the document, and then creating another instance of it saves the conversion changes which then results in validate returning true.

Many thanks for your help
Regards
Rahul

Hi Rahul,


Thanks thanks for your feedback. It is good to know that suggested code worked for you. Yes you are right we need to save after convert method to commit changes.

Please feel free to contact us for any further assistance.

Best Regards,