below command has been executed as part of spinning up the container.
RUN apt-get install libfontconfig1
RUN apt-get update; apt-get install -y ttf-mscorefonts-installer fontconfig
If you add reference to SkiaSharp.NativeAssets.Linux, you should also install libfontconfig1 in your system. SkiaSharp.NativeAssets.Linux depends on this library. You can use the following command to install it:
If you do not have rights to install packages, or other reasons not to install libfontconfig1, you can simply use SkiaSharp.NativeAssets.Linux.NoDependencies , which does not require installation of libfontconfig1.
Also, the problem on your side might occur because the fonts used in your input document are not available on the machine where document is processed. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts: https://docs.aspose.com/words/net/specifying-truetype-fonts-location/
Here is PDF document produced on my side: out.pdf (145.0 KB)
thanks for the suggestions. it seems that the header is working fine now. however the Wingdings font used to generate the checkbox does not work fine as per attached file. Is there anyway we can make the checkbox work in linux server? Any way we can install the “wingdings” font in linux? AKSLinuxDoco.pdf (127.6 KB)
@tinbird Sure, you can implement IWarningCallback to get notifications when font substitution is performed. If some font used in the document is not available, the warning callback will show a warning about the font substitution.
Also, you can use the following code to get list of fonts available in the specified font settings:
/// <summary>
/// Prints the fonts avaialble in the specified font settings.
/// </summary>
public static void PrintAvaialbleFonts(FontSettings fs)
{
foreach (FontSourceBase fsb in fs.GetFontsSources())
{
Console.WriteLine(fsb.Type);
foreach (PhysicalFontInfo pfi in fsb.GetAvailableFonts())
{
Console.WriteLine(pfi.FullFontName);
}
Console.WriteLine("================================================");
}
}