Use setSimpleColumn(), it's simpler. When you call go(), even in
simulation, the content is consumed. It should be:

ColumnText ct = new ColumnText(cb);
Phrase phr=new Phrase("Some text.\n\n", 
FontFactory.getFont(FontFactory.HELVETICA, 12));
ct.addText(phr);
ct.setSimpleColumn(56,52,483,790);
ColumnText ct2 = ColumnText.duplicate(ct);
 
ct.go(true);
ct2.go(); 


Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Vincent CAURIER
> Sent: Friday, March 30, 2007 11:51 AM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Detect when new page
> 
> I had a look at the examples about ColumnText. I tried to 
> make a simple application using them. I encounter a strange 
> problem. Here is the code :
> 
> ColumnText ct = new ColumnText(cb);
> Phrase phr=new Phrase("Some text.\n\n", 
> FontFactory.getFont(FontFactory.HELVETICA, 12));
> ct.addText(phr);
> float[] left1  = {56,790, 56,52};
> float[] right1 = {483,790, 483,52};
> ct.setColumns(left1, right1);
> 
> ct.go(true);
> ct.go();
> 
>  If I try to simulate to add a Phrase, it'll never add 
> anything after this, even if I use ct.go(). Is my code wrong ?
> 
> 
> 
> 2007/3/30, Bruno Lowagie (iText) < [EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]> >:
> 
>       Vincent CAURIER wrote:
>       > Ok, it seems to be a "powerful" component, but I have 
> a last question, 
>       > before trying to implement ColumnText. Is it possible 
> to remove an
>       > Element from a Document ?
>       
>       No.
>       
>       > Or is there a way to do it ?
>       
>       You add the ColumnText in 'simulation mode'. 
>       Meaning you 'pretend' to add the content in
>       order to get information about:
>       - the number of lines,
>       - the Y position,
>       - ...
>       If these values are OK to you, you add the
>       content to the ColumnText again, and you 
>       decide if you add it to the current page,
>       or the next page.
>       This is all explained in chapter 7 of the book.
>       br,
>       Bruno
>       
>       
> --------------------------------------------------------------
> -----------
>       Take Surveys. Earn Cash. Influence the Future of IT 
>       Join SourceForge.net's Techsay panel and you'll get the 
> chance to share your
>       opinions on IT & business topics through brief 
> surveys-and earn cash
>       
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV 
> <http://www.techsay.com/default.php?page=join.php&p=sourceforg
> e&CID=DEVDEV> 
>       _______________________________________________
>       iText-questions mailing list
>       [email protected] 
> <mailto:[email protected]> 
>       https://lists.sourceforge.net/lists/listinfo/itext-questions
>       Buy the iText book: 
> http://itext.ugent.be/itext-in-action/ 
> <http://itext.ugent.be/itext-in-action/> 
>       
> 
> 
> 
> 
> -- 
> Vincent CAURIER
> 
> 


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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/

Reply via email to