Example usage for com.lowagie.text.pdf PdfPTable setRunDirection

List of usage examples for com.lowagie.text.pdf PdfPTable setRunDirection

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPTable setRunDirection.

Prototype

public void setRunDirection(int runDirection) 

Source Link

Document

Sets the run direction of the contents of the table.

Usage

From source file:com.jk.framework.desktop.swing.dao.TableModelPdfBuilder.java

License:Apache License

/**
 * Creates the pdf table./*from   www  .ja  v a 2  s .co  m*/
 *
 * @return the pdf P table
 * @throws DocumentException
 *             the document exception
 * @throws IOException
 *             Signals that an I/O exception has occurred.
 */
public PdfPTable createPdfTable() throws DocumentException, IOException {
    final Font font = getFont();
    int columnCount = 0;
    for (int i = 0; i < this.model.getColumnCount(); i++) {
        if (this.model.isVisible(i)) {
            columnCount++;
        }
    }
    final PdfPTable pdfPTable = new PdfPTable(columnCount);
    pdfPTable.setRunDirection(getRunDirection());
    pdfPTable.getDefaultCell().setRunDirection(getRunDirection());
    pdfPTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
    pdfPTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    pdfPTable.getDefaultCell().setNoWrap(true);

    createPdfHeaders(pdfPTable, font);
    loadDataTable(pdfPTable, font);
    return pdfPTable;

}