Example usage for com.itextpdf.layout.layout LayoutContext LayoutContext

List of usage examples for com.itextpdf.layout.layout LayoutContext LayoutContext

Introduction

In this page you can find the example usage for com.itextpdf.layout.layout LayoutContext LayoutContext.

Prototype

public LayoutContext(LayoutArea area) 

Source Link

Usage

From source file:org.zafritech.zidingorms.io.pdf.TableHeader.java

public void TableHeaderEventHandler(Document doc) {

    this.doc = doc;
    this.table = new Table(1);
    table.setWidth(523);/*from w ww.  j a va2s  .  c  om*/
    table.addCell("Header Roow 1");
    table.addCell("Header Roow 2");
    table.addCell("Header Roow 3");
    TableRenderer renderer = (TableRenderer) table.createRendererSubTree();
    renderer.setParent(new Document(new PdfDocument(new PdfWriter(new ByteArrayOutputStream()))).getRenderer());
    this.tableHeight = renderer.layout(new LayoutContext(new LayoutArea(0, PageSize.A4))).getOccupiedArea()
            .getBBox().getHeight();
}