Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Aug 19, 2024 9:11 am

Using the Windows 11 system, the trial version of Spire.Doc, and the .NET 6.0 framework, I tested the following code:
Code: Select all
document.LoadFromFile(wordFilePath);
// Convert to PDF
document.SaveToFile(pdfFilePath, FileFormat.PDF);
document.Close();
document.Dispose();

The DOCX document to be converted contains various fonts. After conversion, fonts like SimLi (Li Shu) are converted to standard fonts, while others like SimSun (Song Ti\宋体) are normal. Even when converting only the SimLi font, it still fails, despite ensuring that the required font is installed on the system.

SimLi font conversion fails regardless of whether it is bold, italic, or regular. The results vary between Windows 11 and Windows 10, with some cases succeeding and others failing.

I have tried various methods:
(1)Hosting with IIS.
(2)
Code: Select all
document.setCustomFontsFolders(fontFolder);

(3)
Code: Select all
parms.PrivateFontPaths.Add(new PrivateFontPath("SimLi", FontStyle.Bold | FontStyle.Italic | FontStyle.Regular, fontPath));

(4)ToPdfParameterList ppl = new ToPdfParameterList();
All have failed.

gaoyukun
 
Posts: 1
Joined: Sat Aug 17, 2024 1:24 am

Mon Aug 19, 2024 10:07 am

Hello,

Thank you for your inquiry. I simulated a docx document and converted it into PDF on my Win10 system, but the issue you described did not occur. I have attached my input and output files for your reference. When you install the font on your system, please try install it for everyone, so that everyone has access to the installed font. Then you can convert again, if you issue still exists, please provide us with the test results for further investigation.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 277
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.Doc