Set Default font in Amazon S3 using Aspose.Words for .NET

Hi,

We are currently using Aspose Words 19.3.0 for .NET and our conversion code is deployed in AmazonS3 bucket. This code converts from a variety of formats html, doc, etc to PDF files.

I’ve tried setting the default fonts in the conversion code using various methods,

One of them here using aspose Words

  1. Set default font in PDF document using Aspose Words

and one here using aspose PDF
2. HTML to PDF for .NET set default FONT-FAMILY

Both these solutions are working fine when tested LOCALLY, but when deployed to the environment servers, the fonts are still not set.

Questions:

  1. Do we need to set/install/access the fonts in the S3 bucket? (Currently, we have a project fonts folder but it seems this approach is not working in remote environments) If so, do we access it the same way like here: Specify TrueType Fonts Location in C#|Aspose.Words for .NET or we have to do something else?

Thanks

@jdacz Looks like in your case the fonts are substituted. You can implement IWarningCallback to get notification when font substitution is performed.
In your case, you can store the fonts in S3 storage and use StreamFontSource to load them. For example see the following article:
https://docs.aspose.com/words/net/integration-in-aws-lambda/#how-to-use-fonts-stored-in-s3-storage-in-aws-lambda

Hi @alexey.noskov,

I’ve checked the documents link that you gave me, though I can’t seem to find the class StreamFontSouce in 19.3.0 Version of Aspose Words.

Are there any other ways we can access the fonts in S3 storage?

Thanks

@jdacz Unfortunately, StreamFontCource is not available in 19.3 version of Aspose.Words. It has been introduced in 19.5 version of Aspose.Words. So I would suggest you to update. You can check an expiration date of your license and check what is the version it allows to update to. Open the license file in Notepad (but take care not to modify and save the license file or it will no longer work) and see the SubscriptionExpiry field.

<SubscriptionExpiry>20220218</SubscriptionExpiry>

It means that you can free upgrade to version of Aspose.Words published before 02/18/2022.