Geert Delanote wrote:
> On Fri, Sep 18, 2009 at 12:10 PM, 1T3XT info <i...@1t3xt.info> wrote:
>> Geert Delanote wrote:
>>> How can I stretch text to fit a tablecell?
>>>
>>> I have a table with 10 rows (The layout contains no vertical lines).
>>> Before the first 5 rows I want a large brace "{". How should I do
>>> that?
>> I'd use a table event to do that.
> 
> Is it possible to give some sample code?

Not with a large brace, but there are some table event examples in 
chapter 10 of "iText in Action". (See http://1t3xt.info/examples )

>>> My plan was to create an extra column, add the "{"-character in a cell
>>> and stretch it over the height of the cell (with Rowpan==5). Is that
>>> possible?
>> That's possible too.
> 
> How?

See below.

>>> I couldn't get the wanted result by changing the font size because the
>>> brace becomes too "bold" and I can't get it aligned at the top of the
>>> cell.
>> OK, it's not possible to stretch the glyph vertically using high-level
>> objects, only horizontally with the method Chunk.setHorizontalScaling().
>> You could set the horizontal scaling to a value < 100% (< 1). That way,
>> the glyph will look "less bold".
> 
> Indeed. I managed to do that, but the brace isn't aligned to the top
> of the cell.
> I use cell.setVerticalAlignment(Element.ALIGN_TOP);

That's because the leading exceeds the height of the brace.
Reduce the leading.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to