Table Column, Row Count : Table « PDF RTF « Java






Table Column, Row Count

Table Column, Row Count
import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;

public class TableColumnRowCountPDF {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter.getInstance(document,  new FileOutputStream("TableColumnRowCountPDF.pdf"));
      document.open();

      Table table = new Table(2, 2); // 2 rows, 2 columns
      table.addCell("0.0");
      table.addCell("0.1");
      table.addCell("1.0");
      table.addCell("1.1");
      document.add(table);
    } catch (Exception e) {
      System.err.println(e.getMessage());
    }
    document.close();
  }
}
           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Table Width PercentageTable Width Percentage
2.PdfPTable: WriteSelectedRowsPdfPTable: WriteSelectedRows
3.Convert2pdfptableConvert2pdfptable
4.Extending PdfPTable LastRowExtending PdfPTable LastRow