Table is not supported anymore, use PdfPTable.
Paulo
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Andrea Lombardoni
> Sent: Tuesday, October 31, 2006 4:35 PM
> To: [email protected]
> Subject: [iText-questions] PdfWriter - unwanted page break after table
>
> I am using itext-1.4.6.jar and I am experiencing the
> following problem.
>
> When using the PdfWriter, after a table is split between two
> pages, an unwanted
> page break occurs. The content resumes on the new page.
>
> Am I doing something wrong or is this a bug?
>
> This was reported also here:
>
> http://thread.gmane.org/gmane.comp.java.lib.itext.general/2292
> 2/focus=22942
>
> but without any definite answer.
>
> The following is the example code:
>
> /**
> Class used to test iText output
> */
> public class TestiText extends PdfPageEventHelper{
> public final static String OUT_FILE_PDF = "out.pdf";
> public final static String OUT_FILE_HTML = "out.html";
> public final static String OUT_FILE_RTF = "out.rtf";
>
> public static void main(String[] args){
> try{
> FileOutputStream pdfOut = new
> FileOutputStream(OUT_FILE_PDF);
> FileOutputStream rtfOut = new
> FileOutputStream(OUT_FILE_RTF);
> FileOutputStream htmlOut = new
> FileOutputStream(OUT_FILE_HTML);
>
> Document doc = new Document(PageSize.A4);
>
> PdfWriter pdfWriter = PdfWriter.getInstance(doc, pdfOut);
> pdfWriter.setPageEvent(new TestiText());
> RtfWriter rtfWriter = RtfWriter.getInstance(doc, rtfOut);
> HtmlWriter htmlWriter =
> HtmlWriter.getInstance(doc, htmlOut);
>
> doc.open();
>
> for(int tc=0;tc<100;tc++){
> Paragraph p = new Paragraph("test para");
> doc.add(p);
>
> Table t = new Table(2);
>
> t.setTableFitsPage(false);
> for(int rc=0;rc<30;rc++){
> Cell c1 = new Cell("table: "+tc+" left row: "+rc);
> Cell c2 = new Cell("table: "+tc+" right row: "+rc);
> t.addCell(c1);
> t.addCell(c2);
> }
> doc.add(t);
> }
> doc.close();
> }catch(Exception e){
> System.out.println("Exception e: "+e);
> }
> }
> }
>
>
>
> --------------------------------------------------------------
> -----------
> Using Tomcat but need to do more? Need to support web
> services, security?
> Get stuff done quickly with pre-integrated technology to make
> your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
> dat=121642
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
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.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions