Free Support Forum -

Setting font during conversion to pdf

Dear Team,
How can we set font type using IWarningCallback interface.
Only if the font is missing during conversion to pdf it should take a default font otherwise it should convert into pdf using the same font as in the original document.
I had referred the link
How to Receive Notification of Missing Fonts and Font Substitution during Rendering

Attached code : (574 Bytes)


The IWarningCallback interface is implemented if you want to have your own custom method called to capture loss of fidelity warnings that can occur during document loading or saving.

We suggest you please read the following article and read the members of FontSubstitutionSettings class.
Font Availability and Substitution

You are using font substitution correctly in your code. You are also setting font’s folder in your code. Please make sure that “Arial” font is present in your font’s folder.

Dear @tahir.manzoor
Thanks for sharing the link… Using the code I converted docx files into Pdf but the contents are missed in the converted pdf .

Attached Samples: (328.4 KB)


Please make sure that the substitution font is present into the font’s folder. We suggest you please read the article shared in my previous post about font availability and substitution.

Dear @tahir.manzoor
Thank you for the reply. The method works perfect as expected.:relaxed:


Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.