Hi there, First of all I want to thank you for accepting my earlier bug fix.
In this email I provide a test case to demonstrate the critical problem that I am having with my project. I have tried to be thorough in my investigation. If it is a mistake in the api usage then please do enlighten me with the correct usage. -- ATTACHMENTS -- * testcase.html - This is indicative of the structure of the data I am trying to represent. * itext.pdf - The pdf output of my pure itext junit test case. * itext.rtf - The rtf output of my pure itext junit test case. * project.pdf - The pdf output of my own larger project application. * project.rtf - The rtf output of my own larger project application. * TestAddTableToList.java - My pure itext junit test case. Note: The main difference between my project output and the test case output is the formatting. I have provided them to prove that my project is manifesting the same problems in exactly the same way. Let me present first the data I am trying to represent and then the pure itext implementation of it in Java. -- DATA -- Please take a look at the attached html file. It is simply indicative of the structure of the data I am trying to represent and easier to visualise than java code. Although my project application is much larger (html to pdf and rtf) I have managed to reproduce it using pure itext api in a junit3 test case which is given a little later. Essentially this data structure is an outer table which encloses a list which in turn encloses another inner table. -- IMPLEMENTATION -- Please take a look at the attached java file. This is a junit3 test case. When run it should produce /tmp/tmp.pdf and /tmp/tmp.rtf. Please modify output path if need be. Below I have provided the expected and actual outcomes of running the junit test case. -- EXPECTED OUTCOME -- I have two expectations of this junit test case. 1. The PDF and RTF output should look the same broadly speaking. 2. The output of the two formats should look very similar to the html file being viewed in a browser. -- ACTUAL OUTCOME -- Please have at hand the attached pdf and rtf files which have been written on my development workstation. 1. The PDF and RTF outputs look very different. 2a. The PDF is missing the inner table. 2b. The RTF output cannot really be described in a simple way except to say that it appears very broken indeed. To conclude the pdf and rtf formats being different and also being individually broken in different ways are critical problems for the commercial project I am working on. If it is me then I would be only too glad to be told the correct usage of the api. However, if it indeed, a problem with itext internals then I would be most grateful for your assistance. Under my rather tight project timescales I anxiously and eagerly await your reply and feedback. Many thanks.Title: title
Before outer table
|
Before list
After list |
After outer table
itext.pdf
Description: Adobe PDF document
itext.rtf
Description: RTF file
project.pdf
Description: Adobe PDF document
project.rtf
Description: RTF file
package com.complinet.dc.consumer.itext;
import java.io.FileOutputStream;
import junit.framework.TestCase;
import com.lowagie.text.Cell;
import com.lowagie.text.Document;
import com.lowagie.text.List;
import com.lowagie.text.ListItem;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Table;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.rtf.RtfWriter2;
public class TestAddTableToList extends TestCase {
public void test() throws Exception {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream("/tmp/tmp.pdf"));
RtfWriter2.getInstance(document, new FileOutputStream("/tmp/tmp.rtf"));
document.open();
document.add(new Paragraph("Before outer table"));
// start outer table
Table outerTable = new Table(1);
Cell outerCell = new Cell();
outerCell.add(new Paragraph("Before list"));
// start list
List list = new List(true);
list.add(new ListItem("Before inner table"));
ListItem innerListItem = new ListItem();
innerListItem.add("Inner table should be just below");
// start inner table
Table innerTable = new Table(2);
innerTable.addCell("foo");
innerTable.addCell("bar");
innerListItem.add(innerTable);
// end inner table
innerListItem.add("Inner table should be just above");
list.add(innerListItem);
list.add(new ListItem("After inner table"));
outerCell.add(list);
// end list
outerCell.add(new Paragraph("After list"));
outerTable.addCell(outerCell);
document.add(outerTable);
// end outer table
document.add(new Paragraph("After outer table"));
document.close();
}
}------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/
_______________________________________________ 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/
