Aspose Word to Pdf - Docker missing symbol font

Hi,

We are using Aspose.Words to generate PDF file from word document. Our service is hosted on Docker environment and the PDF generated through service has symbol (bullet point - dark dot circle) replaced by another symbol. I have already include MS TTF font image in docker file however the symbol fonts are still not supported. Can you please advise which fonts need to be include in the docker image to resolve the issue?

@asposeworduser100 Could you please attach your input document, output PDF and Dockerfile here for investigation? We will check the issue and provide you more information.
Usually bullets use Wingdings font, but in your document some other font might be used. You can convert your document to PDF on Windows and check what fonts are embedded into the output PDF. Then you can check whether the fonts are available in your Docker.

Thanks for your response. The font used for bullet points are - symbol as shown below.
Fonts.JPG (13.3 KB)

code snippet from my docker file

For Aspose PDF - install libgdiplus + Microsoft fonts

RUN apt-get update && apt-get install -y libfontconfig1
RUN apt-get update && apt-get install -y libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev
RUN apt-get update && apt-get install -y libgdiplus
RUN sed -i’.bak’ ‘s/$/ contrib/’ /etc/apt/sources.list
RUN apt-get update && apt-get install -y ttf-mscorefonts-installer fontconfig

@asposeworduser100 Could you please attach your input and output documents here for testing? We will check the issue and provide you more information.

sample.docx (55.7 KB)
sample_0106.pdf (22.8 KB)
Hi,

Please find attached sample docx and pdf files.

@asposeworduser100 Thank you for additional information. I checked your document and managed to reproduce the problem. The reason of the problem is that Symbol font does not exist in your Docker.
ttf-mscorefonts-installer package does not contain this font. It contains only few ‘core’ windows fonts:

  • Andale Mono
  • Arial Black
  • Arial (Bold, Italic, Bold Italic)
  • Comic Sans MS (Bold)
  • Courier New (Bold, Italic, Bold Italic)
  • Georgia (Bold, Italic, Bold Italic)
  • Impact
  • Times New Roman (Bold, Italic, Bold Italic)
  • Trebuchet (Bold, Italic, Bold Italic)
  • Verdana (Bold, Italic, Bold Italic)
  • Webdings

Since Aspose.Words cannot find the Symbol font it substitutes it with most suitable from available fonts - Webdings. You can check font substitutions by caching the appropriate warnings. See the code below:

Document doc = new Document("/Temp/in.docx");
doc.WarningCallback = new HandleDocumentWarnings();
doc.Save("/Temp/out.pdf");
public class HandleDocumentWarnings : IWarningCallback
{
    public void Warning(WarningInfo info)
    {
        // We are only interested in fonts being substituted.
        if (info.WarningType == WarningType.FontSubstitution)
        {
            Console.WriteLine(info.WarningType + " :: " + info.Description.ToString());
        }
    }
}

You can use the following code to check what fronts are available:

// by default FontSettings contains only system font source.
FontSettings fs = new FontSettings();
FontSourceBase[] fontSources = fs.GetFontsSources();
foreach (FontSourceBase fontSource in fontSources)
{
    foreach (PhysicalFontInfo pfi in fontSource.GetAvailableFonts())
        Console.WriteLine(pfi.FullFontName);
}

To get the expected output you should install Symbol font or copy it in some folder and set this folder as font source. See the following link for more information:

Thanks for your response.
I will try copying symbol.ttf in docker file and see if it resolve the issue.