I have developed a program and I created a column and inserted a paragraph into that column.
ColumnText ct = new ColumnText(cb);
Font font = new Font(bfBold.createFont());
//float maxFontSize=10;
font.setSize(10);
Paragraph p = new Paragraph("This is a long paragraph that doesn't fit the width we defined for the simple column of the ColumnText object, so it will be distributed over several lines (and we don't know in advance how many).",font);
p.setAlignment(Element.ALIGN_JUSTIFIED);
//LineNumberReader lineNumberReader = new LineNumberReader(new StringReader());
ct.setSimpleColumn(100f, 550f, 395f, 150f);
ct.addElement(p);
ct.go();
I have inserted paragraph into ct(column text)
.
So now I wanted to count lines of this paragraph. So how can I do that?
I used itext api. I'm generating a pdf here.