Re: Conversion of text file to PdfA1b failed

Hello,

I am using the latest version of Aspose.Words and I still get this error. After I convert a basic document (doc, txt, etc.) and try to validate the created pdf it returns false:

// Converting
Document document = new Document(@"C:\Temp\Test.txt");
document.Save(@"C:\Temp\Test.pdf", new PdfSaveOptions {SaveFormat = SaveFormat.Pdf, Compliance = PdfCompliance.PdfA1b});

// Validating
Document document = new Document(@"C:\Temp\Test.pdf");
bool result = document.Validate(@"C:\Temp\Log.txt", PdfFormat.PDF_A_1B);
Assert.IsTrue(result); // Fails

1.0Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved.13.10.2015 16:41:02Width information for glyphs is inconsistent in embedded font 'FAAAAJ+TimesNewRomanPS-BoldMT'

(the same happens for Slides Presentation, but not for Cells Workbook)

Do I have to change something of my implementation?

Best regards,
Eric Fago
Hello,

After I converted a basic document (html, txt, etc.) as a PDF-A-1B and try to validate the created PDF (PDF-A-1B), the method returns false (I am using the latest version of Aspose.Words and Aspose.Pdf):

// Converting (Aspose.Words)
Document document = new Document(@"C:\Temp\Test.html");
document.Save(@"C:\Temp\Test.pdf", new PdfSaveOptions {Compliance = PdfCompliance.PdfA1b});

// Validating (Aspose.Pdf)
Document document = new Document(@"C:\Temp\Test.pdf");
bool result = document.Validate(@"C:\Temp\Log.txt", PdfFormat.PDF_A_1B);
Assert.IsTrue(result); // Fails


1.0
Copyright (c) 2001-2012 Aspose Pty Ltd. All Rights Reserved.
13.10.2015 16:41:02








Width information for glyphs is inconsistent in embedded font 'FAAAAJ+TimesNewRomanPS-BoldMT'






(the same happens for Slides Presentation, but not for Cells Workbook)

Do I have to change something of my implementation?

Best regards,
Eric Fago

Hi Eric,


Thanks for your inquiry. Could you please attach your input Word, Text and PowerPoint files here for testing? We will investigate the issue on our end and provide you more information.

Best regards,
Hello,

thank you for your quick response.

I uploaded a ZIP file with all of the documents who are causing me trouble. I created each document with Microsoft Word, PowerPoint or Outlook. Most of them have problems with embedded fonts (according to the validation output).

I am converting the documents like this:
// Cells
Workbook workbook = new Workbook(sourcePath);
workbook.Save(destinationPath, new PdfSaveOptions {Compliance = PdfCompliance.PdfA1b});
// Pdf
Document document = new Document(sourcePath);
if (!document.Convert(new VoidStream(), PdfFormat.PDF_A_1B, ConvertErrorAction.None))
throw new ArgumentException("Could not convert to PDF/A-1B compliant document!", "sourcePath");
document.Save(destinationPath);
// Slides
using (Presentation presentation = new Presentation(sourcePath))
presentation.Save(destinationPath, SaveFormat.Pdf, new PdfOptions {Compliance = PdfCompliance.PdfA1b});
// Words (and Email)
Document document = new Document(sourcePath);
document.Save(destinationPath, new PdfSaveOptions {SaveFormat = SaveFormat.Pdf, Compliance = PdfCompliance.PdfA1b});

Best regards,
Eric Fago

Hi Eric,


Thanks for sharing the resource files.

We are working on testing the scenario in our environment and will get back to you soon.

Hi Eric,

I have tested the scenario using Aspose.Slides for .NET 15.4.0 and have observed that Slides are not properly converted to PDF/A format. However as a workaround, please save the Presentations to PDF format and then use Aspose.Pdf for .NET to transform the output in PDF/A_1b format. Please take a look over following code snippet.

Similar approach can be used for conversion of Word files to PDF/F format.

[C#]

// Slides to PDF conversion
using (Aspose.Slides.Presentation presentation = new Aspose.Slides.Presentation(@"C:\pdftest\Basic.ppsx"))
    presentation.Save(@"C:\pdftest\Basic_converted.pdf",
                        Aspose.Slides.Export.SaveFormat.Pdf,
                        new Aspose.Slides.Export.PdfOptions { Compliance = Aspose.Slides.Export.PdfCompliance.PdfA1b });

// PDF to PDF/A conversion
Document document = new Document(@"C:\pdftest\Failed+Basic_converted.pdf");
document.Convert(@"C:\pdftest\Basic_converted_log.txt", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
document.Save(@"C:\pdftest\Basic_converted_PDF_A1b.pdf");