Hi,
Thanks for your further feedback.
We have two solutions to embed fonts into PDF so that the result pdf can display correctly in other computer without installing the related fonts.
Solution 1:
- Code: Select all
Document document = new Document();
document.LoadFromFile("sample.docx");
ToPdfParameterList parms = new ToPdfParameterList()
{
IsEmbeddedAllFonts = true
};
document.SaveToFile("result.pdf", parms);
If you don't want to install the font on your server, you can use the below solution to embedd the font into PDF.
Solution 2:
- Code: Select all
Document document = new Document();
document.LoadFromFile("sample.docx");
ToPdfParameterList parms = new ToPdfParameterList()
{
PrivateFontPaths = new List<PrivateFontPath>()
{ new PrivateFontPath("Bar-Code 39","C:\\Windows\\Fonts\\Bar-Code 39.ttf") }
};
document.SaveToFile("result.pdf", parms);
When using solution1 to do the conversion, please ensure your working computer installs the font.
When using solution2, it doesn't need your computer installs the font.
Sincerely,
Caroline
E-iceblue support team