Hi,
While converting a text file to PdfA1b I am getting an error.
XML log file says “CMap is not embedded for font ‘TimesNewRomanPSMT’”
Code:
var filNameText = "C:\\Temp\\myfile.txt";
var filNamePdf = "C:\\Temp\\myfile.pdf";
var word1 = new Aspose.Words.Document(filNameText);
var saveOp = new PdfSaveOptions();
saveOp.SaveFormat = SaveFormat.Pdf;
saveOp.Compliance = PdfComplaince.Pdf1Ab;
saveOp.EmbedFullFonts = true;
word1.Save(fileNameP)
var doc = new Aspose.Pdf.Document(filNamePdf);
var isValidFile = doc.Convert("C:\\Temp\\MyfileLog.xml", PdfFormat.PDF_A_1B); //false
Error file log look like this.
CMap is not embedded for font 'TimesNewRomanPS-BoldMT'
CMap is not embedded for font 'TimesNewRomanPSMT'
Your help at earliest will be appreciated.
Regards,
YM
Sure, you can specify the PDF standards compliance level to PdfA1b during rendering your Word document to PDF format. Here is the simple code snippet to achieve this:
DocumentBuilder builder = new DocumentBuilder();
builder.Writeln("Hello World");
PdfSaveOptions options = new PdfSaveOptions();
options.SaveFormat = SaveFormat.Pdf;
options.Compliance = PdfCompliance.PdfA1b;
builder.Document.Save("C:\test\out.pdf", options);
In this case, the output PDF file will comply with the PDF/A-1b standard. PDF/A-1b has the objective of ensuring reliable reproduction of the visual appearance of the document.
Moreover, could you please attach your input text file, you’re getting this problem with, here for testing? I will investigate the issue on my side and provide you more information.
Thanks for the reply, my previous post has a minor typing error.
Unfortunately my development pc is not connected to internet so I have to type the code.
Anyway the problem is not in converting but validation. When I call the validate method for a converted Pdf file to check for Pdf1Ab complaince it return false.
var doc = new Aspose.Pdf.Document(RecentlyConvertedPdfFile);
var isValidPdfA1b = doc.Validate(LogFileXml, PdfFormat.PDF_A_1B);
I have tested your code and it has the same issue. The file when opened in Acrobat reader has what we expect, but validation fails.
You can just call the validate method by yourself with a simple text file having a sentence or even what you already done with document builder and see log file.
I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-6680. Your request has been linked to this issue and you will be notified as soon as it is resolved.