我遇到問題。如果我給它我的字符串姓的值來創建一個段落,我不知道,怎麼給它來後轉換成PDF文件,this -> document.Add(surnameValue);
如何在C#中創建樣式像使我的字符串更加粗體
Paragraph surnameValue = new Paragraph(surname);
我遇到問題。如果我給它我的字符串姓的值來創建一個段落,我不知道,怎麼給它來後轉換成PDF文件,this -> document.Add(surnameValue);
如何在C#中創建樣式像使我的字符串更加粗體
Paragraph surnameValue = new Paragraph(surname);
您可以在iTextSharp的這樣的添加字體這個段落樣式:
BaseFont bfTimes = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, false);
Font times = new Font(bfTimes, 12, Font.BOLD, Color.RED);
Paragraph testP = new Paragraph("This is a Red Font Test using Times Roman", times)
編輯
這裏Documentation大約字體。
不起作用:(我成爲一個錯誤,它不承認以下事情是在「」向您展示: 「Font」times = new「Font」(bfTimes,12,Font。「BOLD」,Color。「RED」); – NinjaCoder
IT只識別「Font」times = new「Font 「........對不起 – NinjaCoder
@NinjaCoder檢查我的編輯 – mybirthname
隨着風格我的意思就像使它粗體或斜體或任何風格喜歡在CSS例如,你可以選擇一切東西... – NinjaCoder
檢查我的答案,並告訴我,如果有什麼不清楚! – mybirthname
@mybirthname它沒有工作,我仍然有同樣的錯誤...不認識「字體」,即使我使用我包括的所有命名空間 – NinjaCoder