Hello everyone,

I am currently using iText (the .NET ported version) to wrap text inside an
invisible box of a certain width and height. That means that the text should
not be wider than the invisible box; if the text is wider than the box, it
should start in a new line. I am using MultiColumnText to do this, as I
found out in iText's forums. This seems to works fine to a certain degree,
but after a few tries on the same document with different text in different
positions and different box dimensions (which involve closing and opening
the PDF file several times), the text seems to not be added anymore. I am
attaching the snippet of code which currently deals with the text wrapping
and adding. 

Does anyone know why adding text using MultiColumnText in any position of
the PDF document won't work? Is there a limit to using MultiColumnText
within a PDF document/page? Or a better solution/implementation to the one I
already use?

Any help would be highly appreciated.

Thank you in advance,
Genti

static void AddTextToFile(int page, int x, int y, int width, int height,
string text, int fontSize)
{
            PdfContentByte cb = stamper.GetOverContent(page);
            Phrase phrase = new Phrase(text, new Font(Font.HELVETICA,
fontSize, Font.NORMAL));
            MultiColumnText mct = new MultiColumnText(y, height);
            mct.AddRegularColumns(x, x + width, width, 1);
            mct.AddElement(phrase);
}
-- 
View this message in context: 
http://itext-general.2136553.n4.nabble.com/iText-and-text-wrapping-using-Multi-ColumnText-tp2284471p2284471.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
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