You cannot really  write inside the rectangle since it is just a graphical
object. However, what you can do is to use the rectangle in hand to
determine the x-y coordinates of where to start writing text using

        ColumnText.showTextAligned(pdfPContentByte, Element.ALIGN_CENTER,
TeacherUse.PHRASE,
                xPos, yPos, 0);

If you want it centered obviously your coordinates would be like

xPos = (rectangle.getLeft() + rect.getRIGHT() ); add any offset if you would
like etc.

I would put all this in a wrapper method so it will be like writing in the
rectangle if that is what you want.

Good luck
Nurettin

On Fri, Feb 4, 2011 at 9:33 AM, Yuri Sarzi <[email protected]> wrote:

> Hi,
> i'm trying to make a sort of labelling system, using your Rectangle class.
> It is quite simple to do, but now i'm in trouble with filling the rectangles
> with text.. I would like to write both horizontally and vertically in my
> rectangles! How do i can do?
>
> Please find attached my java class (it makes a pdf file with rectangles)
>
> Best Regards
> Yuri Sarzi
>
>
>
>
> ------------------------------------------------------------------------------
> The modern datacenter depends on network connectivity to access resources
> and provide services. The best practices for maximizing a physical server's
> connectivity to a physical network are well understood - see how these
> rules translate into the virtual world?
> http://p.sf.net/sfu/oracle-sfdevnlfb
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Many questions posted to this list can (and will) be answered with a
> reference to the iText book: http://www.itextpdf.com/book/
> Please check the keywords list before you ask for examples:
> http://itextpdf.com/themes/keywords.php
>



-- 
Nurettin DAG
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to