我嘗試用ColumnText設置字體,但它不工作。用ColumnText設置字體
PdfContentByte cb = writer.DirectContent;
BaseFont title = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, BaseFont.WINANSI, BaseFont.EMBEDDED);
cb.SetFontAndSize(title, 10); //10 is the font size
string text = "this is sample of long long long paragraph..";
ColumnText column1 = new ColumnText(cb);
column1.SetSimpleColumn(255, 145, 600, 100);
Paragraph p;
p = new Paragraph(new Paragraph(text));
column1.Go();
我想這個代碼,它不工作,以及:
p = new Paragraph(new Paragraph(text, cb.SetFontAndSize(title, 10)));
錯誤消息:The best overloaded method match for 'iTextSharp.text.Paragraph.Paragraph(string, iTextSharp.text.Font)' has some invalid arguments
有人能指點我?謝謝
感謝您的答覆,但它不工作爲好,同樣的錯誤信息 – user3431239