For pdf to html conversion using Aspose.PDF for .NET, can we include ttf-mscorefont-installer in a docker image as per licence terms? If not, what is the other way?

Hi team,
I am using Aspose.PDF.Drawing in linux environment and it needs ttf-mscorefont-installer. I want to containerize that application and need to include the commands for ttf-mscorefont-installer in my dockerfile

RUN wget
&& apt-get install -y ./ttf-mscorefonts-installer_3.8_all.deb
&& apt-get clean
&& rm -rf /var/lib/apt/lists/* ./ttf-mscorefonts-installer_3.8_all.deb

Is this allowed according to the EULA terms which includes the following

GRANT OF LICENSE. This EULA grants you the following rights:

  1. Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.
  2. Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT; provided that each copy shall be a true and complete copy, including all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may not be distributed for profit either on a standalone basis or included as part of your own product.

If the above voilates the license terms, what is the way i can use the ttf-mscorefonts-installer for my application without any license issues ?


This is not our product, and here I, as an outsider, can confirm my understanding that this product cannot be used for commercial use.
Alternatively, you can provide for Aspose.Pdf library the external font definition for the font if it’s not installed in the system:

FontRepository.Sources.Add(new FolderFontSource("path_to_the_folder_with_the_font"));

is there any open source available to download the fonts and use them?

Using the above approach, you can not download the fonts, but copy the font files into the docker container and point the library to the path to them. I won’t recommend fonts that can be freely used. But if you look, you can find them.

Documentation available on aspose website states that Aspose.PDF.Drawing should be used to avoid the bugs associated with using System.Drawing.Common on non-windows platforms while using Aspose.PDF. It also states that ‘ttf-mscorefonts-installer’ and ‘fontconfig’ packages are needed for successful working of Aspose.PDF.Drawing for .NET library in Docker. But if ttf-mscorefonts-installer cannot be used for commercial use, how are the customers of Aspose might be utilizing these packages? And just to know, are you @sergei.shibanov from Aspose team ?

Yes, I’m Sergei Shibanov, I work at Aspose, including on this forum.
And while working on the forum, I often came across questions about problems due to the lack of necessary fonts in Linux.
The development team is working on this and in the new version of Aspose.Pdf 24.04 (scheduled for release this week and which will now use Aspose.Drawing, i.e. we can say that the Aspose.Pdf.Drawing option has become Aspose.Pdf) lack of fonts from the ttf-mscorefonts-installer package will not affect as much as before.
Strictly speaking, the work requires, first of all, Arial fonts and Times New Roman (files arial.ttf and times.ttf) and for users who were interested in this, I offered the option described above and this suited everyone.
forFontsInLinux.png (5.3 KB)
I don’t think any of them used the library for commercial purposes and ignored the license agreements.
I will look into this aspect and write to you.

First of all: the question is primarily legal, not technical, and what I write is simply my assessment.
The situation is ambiguous, I think you saw The Legality of Microsoft Fonts - Microsoft Q&A, as well as the answer to your question Redirecting. Those. everything is obvious about copying and installation - no restrictions. But for commercial use, there may still be questions. There is a detail that the library uses font embedding, and checks the corresponding flag. This is indirectly confirmed by the presence of the Document.DisableFontLicenseVerifications property.
And this seems to be allowed (Font redistribution FAQ - Typography | Microsoft Learn). The truth is that there is a contradiction with the EULA requirement for consistent use of fonts. To be on the safe side, it is possible to embed entire fonts by setting Subset to false. But this will lead to significant swelling of the documents and still will not give complete confidence.
Thank you for raising this issue - I will indicate to management the need to continue work to decouple the need for MS fonts for the library to work.

Hi @sergei.shibanov

Thanks for your response.

I have a doubt regarding how font substitution process work during the document conversion with your package. If i want to convert pdf to html in linux and that pdf conatins some text in ttf fonts such as Arial or Times Roman. When converting, if the linux machine doesn’t contains the exact ttf font, will it search for a font similar to that or it simply throws an exception. Because i am trying to use some alternative font libraries that provide similar fonts to microsoft’s ttf fonts but still doesn’t work. (I am using Aspose.PDF with .NET)

You should explicitly specify font substitutions.

FontRepository.Substitutions.Add(new SimpleFontSubstitution("MinionPro-Regular", "Arial"));


Appreciate you quick response.

I have an application that uses Aspose.PDF with JAVA that does the same conversion process and it works in linux without microsoft’s TrueType fonts and without any explicit font substitution. Why is it not working for .NET. Is the way these libraries handle fonts different or any other reason?

These libraries should work the same and such a difference is not clear. Maybe when you install the java environment in Docker, fonts are installed along with it?
Try to see from the environment what fonts are available after downloading everything you use.
In C# it looks like this,

var fonts = new InstalledFontCollection();
Console.WriteLine("installed fonts:");
foreach (FontFamily family in fonts.Families)

in Java there is probably something similar.