Put a newPage() between the MultiColumnText.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, April 22, 2008 10:40 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] More than one MultiColumnText in a document
> 
> 
> Hello, 
> 
> I am trying to build a document that contains 1 to n 
> MultiColumnTexts (MCTs). 
> If these MCTs have different column counts, the program runs 
> into an infinous 
> loop, when I call document.add([MCT]). 
> Is it because of a limitation of the MCT or is it a bug or am 
> I just doing something 
> wrong? 
> 
> Here is a small code sample to reproduce this error: 
> 
> import java.io.ByteArrayOutputStream; 
> 
> import com.lowagie.text.Document; 
> import com.lowagie.text.DocumentException; 
> import com.lowagie.text.Paragraph; 
> import com.lowagie.text.pdf.MultiColumnText; 
> import com.lowagie.text.pdf.PdfWriter; 
> 
> 
> public class TestMCT { 
> 
>   /** 
>    * @param args 
>    */ 
>   public static void main(String[] args) { 
>     // TODO Auto-generated method stub 
>     Document doc=new Document(); 
>     ByteArrayOutputStream b_out = new ByteArrayOutputStream(); 
>     try { 
>       PdfWriter writer = PdfWriter.getInstance(doc, b_out); 
>       doc.open(); 
>       MultiColumnText columns = new MultiColumnText(doc.top() - 20); 
>       columns.addRegularColumns(doc.left(), doc.right(), 20, 1); 
>       columns.setSpaceCharRatio(100f); 
>       columns.addElement(new Paragraph("Test")); 
>       doc.add(columns); 
>       MultiColumnText columns2 = new MultiColumnText(doc.top() - 20); 
>       columns2.addRegularColumns(doc.left(), doc.right(), 20, 2); 
>       columns2.setSpaceCharRatio(100f); 
>       columns2.addElement(new Paragraph("Test")); 
>       doc.add(columns2); 
>       doc.close(); 
>       
>       
>     } 
>     catch (DocumentException e) { 
>       // TODO Auto-generated catch block 
>       e.printStackTrace(); 
>     } 
>     
> 
>   } 
> 
> } 
> 
> Thank you in advance and best regards 
> Christian 


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.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to