Reputation: 61
Phrase p1Header = new Phrase("Hello World", FontFactory.GetFont("verdana", 15, Font.BOLD));
It just makes Hello World
bold. I want to give the color to it as well.
Upvotes: 2
Views: 12571
Reputation: 851
Define the font and add to the Paragraph
iTextSharp.text.Font myFont= FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.BOLD, new iTextSharp.text.BaseColor(0, 0, 255));
Paragraph myParagraph = new Paragraph("MyField", myFont);
Upvotes: 0
Reputation: 374
Try the following.
Phrase p1Header = new Phrase("Hello World",FontFactory.GetFont("Times New Roman", 10, Font.BOLD, new Color(255, 255, 255)));
Upvotes: 2