We are having font issue when docx file is saved as pdf when using aspose.word.dll version 18.12.0 when using windows server 2016.Fonts are more bolded in pdf.Attached sample has the FontIssue.docx. Seems like windows server 2016 related.Our aspose order id is 180115093517WindowsFormsApplication3.zip (9.3 MB)
Random rnd = new Random();
var doc = new Aspose.Words.Document(Application.StartupPath + @"\FontIssue.docx");
string rootPath = Path.GetPathRoot(Application.StartupPath);
doc.AcceptAllRevisions();
doc.Save(Application.StartupPath+@"\"+ rnd.Next(1, 777777) + ".pdf", Aspose.Words.SaveFormat.Pdf);
FontIssue.docx
OS Name: Microsoft Windows Server 2016 Datacenter
OS Version: 10.0.14393 N/A Build 14393
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: Intel64 Family 6 Model 85 Stepping 4 GenuineIntel ~2500 Mhz
[16]: KB4493470
Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install fonts e.g. ‘Helvetica LT Std’ that are used in your document on the machine where you are converting documents to PDF. Please refer to the following articles:
You mean the server that convert the doc to pdf need the font right?Anything we can do to programmatically fix this?Installing font is only option?Can we know the list of possible fonts aspose is expecting?
You need to install font ‘Helvetica LT Std’ on the system where you are converting document to PDF.
The required fonts for rendering are those which are used in your document. E.g. in your shared document only ‘Helvetica LT Std’ font is present. Below code example shows how to gather the details of what fonts are present in a document.
Document doc = new Document(MyDir + "Document.doc");
FontInfoCollection fonts = doc.FontInfos;
int fontIndex = 1;
// The fonts info extracted from this document does not necessarily mean that the fonts themselves are
// used in the document. If a font is present but not used then most likely they were referenced at some time
// and then removed from the Document.
foreach (FontInfo info in fonts)
{
// Print out some important details about the font.
Console.WriteLine("Font #{0}", fontIndex);
Console.WriteLine("Name: {0}", info.Name);
Console.WriteLine("IsTrueType: {0}", info.IsTrueType);
fontIndex++;
}
The recommended fonts for document rendering are those that are used in the document. You can use the code example shared in my previous post to get the list of fonts used in the document. You can also get the missing font notification using the code example shared in the following article.
we cant handle the missing font on run time.We were just trying to get all common fonts that need to installed on server.Do you have a list of common fonts recommended was the questions so we can install it on the server as base
The common fonts are available on Windows operating system. You can find them in Windows/Fonts folder. Please check the list of common typefaces from here: List of typefaces included with Microsoft Windows