Support of font replacement introduced in PDF to PDFA conversion in Aspose.Pdf for .NET 11.8.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

We are pleased to announce new version of Aspose.Pdf for .NET, Aspose.Pdf for .NET 11.8.0 . This month release is mainly a maintenance release with couple of enhancements. It includes replacement of fonts in PDF to PDFA conversion as main enhancement. This release includes fixes of bugs reported by our valued customers in previous releases, that makes it more stable and better release as compared to previous versions. Some of these bug fixes related to PDF to PDFA, PDF to XPS, PDF to HTML, HTML to PDF, rendering XFA form to Static form, PDF to image. Please check release notes of Aspose.Pdf for .NET 11.8.0 for complete list.

Replacing missing fonts with alternative fonts in PDF to PDFA conversion

In PDF to PDFA conversion, sometimes fonts are neither embedded in source PDF document and nor available on machine, so it is required to replace missing fonts with some alternative fonts. We can substitute missing fonts as following.

Aspose.Pdf.Text.Font originalFont = null;
try
{
originalFont = FontRepository.FindFont("AgencyFB");
}
catch (Exception)
{
//Font is missing on destination machine
FontRepository.Substitutions.Add(new SimpleFontSubstitution("AgencyFB", "Arial"));
}
var fiNew = new FileInfo("newfile.pdf");
var pdf = new Document("myfile.pdf");
pdf.Convert("convertlog.xml", PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
pdf.Save(fiNew.FullName);

Aspose.Pdf for .NET Resources

The following resources will help you work with Aspose.Pdf for .NET: