Example usage for com.lowagie.text.pdf ColumnText getFilledWidth

List of usage examples for com.lowagie.text.pdf ColumnText getFilledWidth

Introduction

In this page you can find the example usage for com.lowagie.text.pdf ColumnText getFilledWidth.

Prototype

public float getFilledWidth() 

Source Link

Document

Gets the real width used by the largest line.

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.internal.PdfLogicalPageDrawable.java

License:Open Source License

protected void drawComplexText(final RenderableComplexText node, final Graphics2D g2) {
    try {/*from  www.ja  va2 s  .  co m*/
        final Phrase p = createPhrase(node);
        final ColumnConfig cc = createColumnText(node);

        final PdfGraphics2D pg2 = (PdfGraphics2D) getGraphics();
        final PdfContentByte cb = pg2.getRawContentByte();
        ColumnText ct = cc.reconfigure(cb, p);
        ct.setText(p);
        if (ct.go(false) == ColumnText.NO_MORE_COLUMN) {
            throw new InvalidReportStateException(
                    "iText signaled an error when printing text. Failing to prevent silent data-loss: Width="
                            + ct.getFilledWidth());
        }
    } catch (DocumentException e) {
        throw new InvalidReportStateException(e);
    }
}