Example usage for com.itextpdf.text.pdf PdfPCell getMaxHeight

List of usage examples for com.itextpdf.text.pdf PdfPCell getMaxHeight

Introduction

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

Prototype

public float getMaxHeight() 

Source Link

Document

Returns the height of the cell.

Usage

From source file:ro.nextreports.engine.exporter.PdfExporter.java

License:Apache License

private float computeFooterHeight() throws QueryException {
    footer = buildPdfTable(PRINT_PAGE_FOOTER);
    if (footer == null) {
        return 0;
    }//  w w w .j av  a2 s . c o m
    printPageFooterBand();

    float height = 0;
    ArrayList<PdfPRow> rows = footer.getRows();
    for (int k = 0; k < rows.size(); k++) {
        PdfPRow row = rows.get(k);
        PdfPCell[] cells = row.getCells();
        float rowHeight = 0;
        for (PdfPCell cell : cells) {
            if (cell == null) {
                rowHeight = Math.max(rowHeight, MINIMUM_HEIGHT);
            } else {
                rowHeight = Math.max(rowHeight, cell.getMaxHeight());
            }
        }
        height += rowHeight;
    }
    return height;
}