2016-04-18 9 views
-2

C#でItextSharpを使用して請求書を作成するのが初めてです。テストお客様のお名前が - - テストCustomr 請求書はありません - 122請求書の日付は - 2016年12月4日には同じ行であるが位置が異なる2つのフレーズ - Itextsharp

+0

2つの列テーブルでこれを実行しようとしましたか? – lukbl

+0

2つの列テーブルを使用して例を挙げてください。それは非常にありがたいです – androidpol

+1

http://stackoverflow.com/questions/29575142/how-to-align-two-paragraphs-to-the-left-and-right-on-the-same-line – lukbl

答えて

1

official documentationを読んでください、あなたがよどのように私は彼が

顧客コードが添付以下のレイアウトでPDFを生成することができます

次のような質問に対する答えを見つけます

もっと一般的な章もあります(例:Q&A about tables)。あなたがPdfPTableを作成しようとしているかのように見えるので、私は、サイトのこの部分に言及しています:

このようなテーブルを作成してみてください:

public static PdfPTable CreateFirstTable() { 
    // a table with three columns 
    PdfPTable table = new PdfPTable(3); 
    // the cell object 
    PdfPCell cell; 
    // we add a cell with colspan 3 
    cell = new PdfPCell(new Phrase("Cell with colspan 3")); 
    cell.Colspan = 3; 
    table.AddCell(cell); 
    // now we add a cell with rowspan 2 
    cell = new PdfPCell(new Phrase("Cell with rowspan 2")); 
    cell.Rowspan = 2; 
    table.AddCell(cell); 
    // we add the four remaining cells with addCell() 
    table.AddCell("row 1; cell 1"); 
    table.AddCell("row 1; cell 2"); 
    table.AddCell("row 2; cell 1"); 
    table.AddCell("row 2; cell 2"); 
    return table; 
} 

Documentにこのテーブルを追加します。

document.add(CreateFirstTable()); 

このシンプルな表は、原則の仕組みを説明しています。 2つの列を持つ表が必要です。そこには、顧客コードと請求書を必要な数だけ追加できます。

関連する問題