Can any one please tell me how to add color between the text.
I have the code like below mentioned. That should be display in single line but “content” should be in different color.
builder.Write(“Header content”);
Please help me on this.
Can any one please tell me how to add color between the text.
I have the code like below mentioned. That should be display in single line but “content” should be in different color.
builder.Write(“Header content”);
Please help me on this.
Please check the following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Starting ");
builder.Font.Color = Color.Red;
builder.Write("word1 ");
builder.Font.Color = Color.Green;
builder.Write("more words ");
builder.Font.Color = Color.Red;
builder.Write("word2' ");
builder.Font.ClearFormatting();
builder.Writeln("ending.");
builder.Write("Second line ");
doc.Save("E:\\Temp\\19.8.docx");
Also, please check how to specify formatting on different elements.