We are getting this error when trying to convert our PDF to PDF/A-3b.
Error and Actual Code below:
Error
System.IO.FileNotFoundException: Could not load file or assembly ‘Aspose.Font, Version=16.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The system cannot find the file specified.
File name: ‘Aspose.Font, Version=16.12.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’
at ? .[1](FontCollection [1], Page
)
at ? .[1](Page [1], [1]
)
at ? .()
at ? . ? ??()
at ? .
at Aspose.Pdf.Document.[1](XmlTextWriter [1], PdfFormat
, Boolean , ConvertErrorAction )
at Aspose.Pdf.Document.Convert(Stream outputLogStream, PdfFormat format, ConvertErrorAction action)
Code Snippet
public class DocumentManager
static DocumentManager()
{
new Aspose.Pdf.License().SetLicense(@“Aspose.Pdf.lic”);
}
public byte[] ConvertToPdfA3(byte[] document)
{
Aspose.Pdf.Document pdfA3 = new Aspose.Pdf.Document(new MemoryStream(document));
MemoryStream outLog = new MemoryStream();
if(!pdfA3.Convert(outLog, PdfFormat.PDF_A_3B, ConvertErrorAction.Delete))
{
StreamReader sr = new StreamReader(outLog);
throw new ApplicationException(string.Format("Failed to Convert: ", sr.ReadToEnd());
}
MemoryStream outStream = new MemoryStream();
pdfA3.Save(outStream, SaveFormat.Pdf);
return outStream.ToArray();
}