Dependency on System Installed fonts (PDF conversion)

Hi There,
We use Aspose words and PDF in our production system to mail merge to docx and then convert it to PDF. Our service is a web API hosted on Microsoft Azure as an app service.
Recently Microsoft updated their font family for Sitka and we started to get error that the font file couldn’t be found. During debug we found the the Aspose PDF has dependency of this fonts to be present in c:\windows\fonts folder.
Now that the Azure App Service is a completely PaaS offering by microsoft, we can’t go install fonts there. We expect the Aspose PDF to be not dependent on any system components.
Now before we look into upgrading the PDF to latest version of Aspose, we would like to know if this kind of external dependencies are removed from the product. Can you please advise or provide a technical support person to help us out?

Kind Regards,
Mitul Patel

Also, It seems like we don’t have any reference to Aspose.PDF in the code. Does Aspose.PDF or Aspose .Cells required when you saving a docx to PDF?

@mitul.patel

The conversion of docx->pdf is carried out by the Aspose.Word library.
There is no such conversion in the Aspose.Pdf library, there is PDF->docx.

Thanks Sergie for confirming. Also it would be great if you can advise on the other question regarding dependency on system fonts for Aspose.words when calling SaveToPdf? Below is the full stack trace. We probably are having older version of Aspose (2009.06.30). We wonder if we purchase newer version the dependency is no longer there as otherwise it can break again when Microsoft does their underlying system upgrades.

Could not find file 'C:\Windows\Fonts\Sitka.ttc'.	
System.IO.FileNotFoundException:
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.IO.Strategies.OSFileStreamStrategy..ctor (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at 䄋.䇁.䇗 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䄋.䇁.䇵 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䄋.䇁.get_䇃 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䄋.䇁.䇜 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䄋.䇁.䅁 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䄋.䇁.৲ (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䃹..ctor (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䅌..ctor (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䃹.䄆 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䄺.৲ (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䍻.䎃 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䍝.㶮 (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 䁕.䁬.VisitGlyphs (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㡿.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㡹.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㣽.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㡹.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㣽.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㡹.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at 㡸.㡼.Accept (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at Aspose.Words.Document.SaveToPdf (Aspose.Words, Version=6.5.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56)
   at XXXX.Reports.CompanyReport.GenerateXXXXReport (XXXX.Reports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: /home/runner/work/XXXX-XXXX/XXXX/src/Reports/XXXX.cs:673)
   at XXXX.XXXX.WebApi.Controllers.XXXXController.XXXX(XXXX.WebApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: /home/runner/work/XXXX-API/XXXX-API/src/Services/HostSite/XXXX.WebApi/Controllers/Reports/XXXXController.cs:45)
   at lambda_method1247 (Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor+SyncObjectResultExecutor.Execute (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeActionMethodAsync>g__Logged|12_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeNextActionFilterAsync>g__Awaited|10_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker+<<InvokeInnerFilterAsync>g__Awaited|13_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeNextResourceFilter>g__Awaited|25_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeFilterPipelineAsync>g__Awaited|20_0>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeAsync>g__Logged|17_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker+<<InvokeAsync>g__Logged|17_1>d.MoveNext (Microsoft.AspNetCore.Mvc.Core, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware+<<Invoke>g__AwaitRequestTask|6_0>d.MoveNext (Microsoft.AspNetCore.Routing, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler+<HandleAsync>d__0.MoveNext (Microsoft.AspNetCore.Authorization.Policy, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware+<Invoke>d__6.MoveNext (Microsoft.AspNetCore.Authorization.Policy, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware+<Invoke>d__6.MoveNext (Microsoft.AspNetCore.Authentication, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1+<ProcessRequestAsync>d__2.MoveNext (Microsoft.AspNetCore.Server.IIS, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)

@mitul.patel
This question relates to another product - Aspose.Word and I will move this topic to the appropriate section, where you will be given a qualified answer.

@mitul.patel Aspose.Words does not have dependency on the font. As I can see you are using a very old version of Aspose.Words. I suppose the problem on your side might occur because Aspose.Words reads the available fonts from the Windows registry and there is registry entry which points to the C:\Windows\Fonts\Sitka.ttc font file, which is not physically available. You can check the following registry entries in LocalMachine and CurrentUser:
SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

And if there is an entry that points to Sitka.ttc and the font is not available in C:\Windows\Fonts\Sitka.ttc, just remove this entry.

But better, I would suggest you to update to a newer vision of Aspose.Words.

Hi Alexey,
Thanks for your response. Can you confirm the updated version of Aspose.Words also does not have any dependency on the registry as it may not be available in PaaS environment. As we look for upgrading the library, I want to be sure the same issue doesn’t happen in future.
Thanks
Mitul

@mitul.patel There is no such problems in newer version of Aspose.Words. Also, in the latest versions of Aspose.Words you can specify where Aspose.Words should look for fonts.
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/