Example usage for com.itextpdf.text.pdf PdfPRow PdfPRow

List of usage examples for com.itextpdf.text.pdf PdfPRow PdfPRow

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfPRow PdfPRow.

Prototype

public PdfPRow(PdfPRow row) 

Source Link

Document

Makes a copy of an existing row.

Usage

From source file:net.pickapack.util.TableHelper.java

License:Open Source License

private static void addRow(PdfPTable table, boolean header, List<String> values) {
    List<PdfPCell> cells = new ArrayList<PdfPCell>();

    for (Object value : values) {
        PdfPCell cell = new PdfPCell(new Phrase(value + "", header ? boldFont : normalFont));
        if (header) {
            cell.setHorizontalAlignment(Element.ALIGN_LEFT);
        }/*from w w w.  j  a  v a  2s .  co m*/

        cells.add(cell);
    }

    table.getRows().add(new PdfPRow(cells.toArray(new PdfPCell[cells.size()])));
}