Phrase p1Header = new Phrase("Hello World", FontFactory.GetFont("verdana", 15, Font.BOLD));
它只是让Hello World
大胆。我也想给它上色。
请尝试以下方法。
Phrase p1Header = new Phrase("Hello World",FontFactory.GetFont("Times New Roman", 10, Font.BOLD, new Color(255, 255, 255)));
定义字体并添加到段落中
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);