Generating tables in PDF output. Tables split across pages are getting an
extra empty row in the table at the split. Can anyone explain how to get rid
of this extra row? There is another post out there on this topic with no
responses.

Thanks!

Sample code

package mil.deca.test;

//java classes
import java.util.*;
import java.io.*;
import java.awt.Color;


import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.html.*;
import java.awt.Point;

public class test2 {

  public test2() {
  }
  public static void main(String[] args) {
    test2 test21 = new test2();
    Document document = new Document(PageSize.LETTER.rotate());
    try {
      PdfWriter.getInstance(document, new
FileOutputStream("C:\\temp\\file.pdf"));
      HtmlWriter.getInstance(document, new
FileOutputStream("C:\\temp\\file.html"));
    } catch ( Exception e ) {
      return ;
    }
    HeaderFooter footer = new HeaderFooter(new Phrase("Page: "), true);
    footer.setBorder(Rectangle.NO_BORDER);
    document.setFooter(footer);
    Phrase hdr = new Phrase("Table Test " +
                 new java.util.Date());
    HeaderFooter header = new HeaderFooter(hdr, false);
    header.setAlignment(Element.ALIGN_CENTER);
    document.setHeader(header);
    document.open();
    try {
    Table testTable = new Table(2);
    for ( int i = 1; i < 200 ; i++ ) {
        testTable.addCell("Cell " + i , new Point(i,0));
        testTable.addCell(Integer.toString(i), new Point(i,1));

    }
    document.add(testTable);
    } catch ( Exception e ) {
      e.printStackTrace();
    }
    document.close();
  }
}

Scott Tinsley
System Administrator
Defense Commissary Agency
804-734-8857



-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to