Thanks for the quick reply. However, I am facing a problem trying to
implement what you suggested. The code below gives me "ColumnText.go with
simulate==false and text==null."
public void cellLayout(PdfPCell cell, Rectangle position, PdfContentByte[]
canvases)
{
cell.Column.setSimpleColumn(new Phrase("test"), position.Left,
position.Bottom, position.Right, position.Top, 15, Element.ALIGN_LEFT);
cell.Column.go();
}
I have not been working with the ColumnText object before, so I might be
missing something here?
/David
Bruno Lowagie (iText) wrote:
>
> davidfossil wrote:
>> When adding a Phrase with a long text string to a narrow PdfPCell the
>> text is
>> automatically wrapped into several lines.
>
> OK.
>
>> In the project I am working on I
>> want the text to wrap, by floating out of the PdfPCell rather than by
>> expanding it.
>
> If that's a requirement: OK.
> Otherwise: not such an elegant way to render a table.
>
>> As a workaround I have set a fixed height on the PdfPCell,
>
> That's a good start.
>
>> causing the text to wrap "into nowhere".
>
> And the extra text is lost.
>
>> My idea here is to then catch the overflown text, to
>> manually add it to the cell below.
>
> My (untested) suggestion is: add empty cells with fixed
> heights. Create a custom Cell Event and pass the content
> of the cell to this Event class. Add such a cell event
> to each cell. In the cell event, render the content of
> the cell using ColumnText and the coordinates passed to
> the event.
>
>> From the iText source I have found that
>> PdfLine.add() and PdfChunk.split() seems that seems to do the actual line
>> splitting, but unfortunately its all package private and I can not seem
>> to
>> find any "entraces" other than compiling my own modified iText.
>
> That's too complex. Use cell events and ColumnText.
> br,
> Bruno
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
>
>
--
View this message in context:
http://www.nabble.com/Capturing-the-overflow-from-PdfPCell-tf4304205.html#a12255262
Sent from the iText - General mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/