2016-06-15 16 views
0

itextsharpを使用してリストをPDFファイルに表示しています。ListItemテキストを太字にしますが、リストアイコンではありません。itextsharp

リスト項目内の内容の一部、私は私の質問でそれを尋ねたとして大胆されています。のListItemのI太字テキスト、リストの番号も取得している場合

Bold some text in Pdf List

今問題があります大胆な。例については

1.Boldテキスト

それはここで

スナップショットである

  1. 太字テキストでなければなりません:

    enter image description here

    どうすれば解決できますか?ここで

    は私のコードです:

    c1 = new Chunk("Earth Pit.", FontFactory.GetFont(FontFactory.TIMES_BOLD, 10,iTextSharp.text.Font.UNDERLINE)); 
         c2 = new Chunk(" The existing earth...", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10)); 
         p_chunk = new Paragraph(); 
         p_chunk.Add(c1); 
         p_chunk.Add(c2); 
         lst_terms.Add(new iTextSharp.text.ListItem(p_chunk)); 
    

答えて

0

これは私のために動作します:あなたが実際にListItemを必要とするとき

Chunk c1 = new Chunk("Earth Pit.", FontFactory.GetFont(FontFactory.TIMES_BOLD, 10,iTextSharp.text.Font.UNDERLINE)); 
Chunk c2 = new Chunk(" The existing earth...", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 10)); 
ListItem li = new ListItem("", FontFactory.GetFont(TIMES_ROMAN, 10)); 
p.Add(c1); 
p.Add(c2); 
lst_terms.Add(li); 

は、なぜあなたはParagraphオブジェクトを作成していますか?

+0

よろしくお願いします。 –

関連する問題