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.

Wed Feb 08, 2023 4:50 pm

Hi we have a question regarding converting docx files to pdf files. We notice that sometimes font are changed, not only font that are not installed on computer but other fonts as well.
For example we have document that I provide that contains two fonts Algerian and Calibri and in pdf document as a result of converting we can find Arial instead of Calibri eaven all 3 fonts are installed.
Do you have any idea way this is happening, I'm sending test file in attacment.
Regards.

bstojanovic
 
Posts: 44
Joined: Mon Sep 28, 2020 2:54 pm

Thu Feb 09, 2023 10:04 am

Hi,

Thanks for your inquiry.
Kindly note that when the fonts are not existed or not installed, Spire.Doc will find the similar fonts for replacement.
In you document, there are actually two fonts, “Algerian” and “Arial”, I did a conversion, the fonts used in result document are the same as the Word document, then I replaced the “Arial” into “Calibri” and did a test, the result is also correct, I did not reproduce your issue. I have attached my test documents for your reference.
In addition, you can put font files in a folder and try the following code.
Code: Select all
            Document doc = new Document();
            doc.LoadFromFile("test.docx");
            PdfDocument.SetCustomFontsFolders("myfontfolder")
            doc.SaveToFile("test.pdf",Spire.Doc.FileFormat.PDF);

If your issue still exists, please provide us with the following messages. Thanks for your assistance.
1) the version of Spire.Doc in your project.
2) the input and output files.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu Mar 02, 2023 8:24 am

Hi,

Greetings from E-iceblue.
How is your issue now? If it has not been solved yet, please provide us with the following messages to help us work out a solution for you. Thanks for your assistance.
1) the version of Spire.Doc in your project.
2) the input and output files.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc