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.
@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:
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.