在很多时候,客户需要在一个Word文档里,使用不同的语言如:英语、中文、阿拉伯文等来书写不同的文本,那么如果让这些文本都能Word文档里正确的显示呢,开发人员可以通过
Aspose.Words文档处理控件轻松实现该功能,通过该控件可以为不同的文本设置不同的字体,具体如下:
string MyDir = GetDataDir_Data();
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Font.Name = "Arial (Body CS)";
// Adding Hindi text in document using required font name
builder.Font.Name = "Nirmala UI Semilight";
builder.Write("অনেক দিন দেখা নেই");
doc.Save(MyDir + "Output.docx");