Example usage for com.itextpdf.layout.layout LayoutArea LayoutArea

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

Introduction

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

Prototype

public LayoutArea(int pageNumber, Rectangle bBox) 

Source Link

Document

Creates the area for content com.itextpdf.layout.renderer.IRenderer#layout(LayoutContext) layouting .

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);//w ww  .  ja  va2 s.  c  o m
    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();
}