Hi,

I am currently building a Java software that develops a PDF file based on a table. However, I am having an issue with getting all the information into the column of the PDF and need help.
I will attach the PDF so you have a good idea of what the PDF file looks like and what I am looking to do. The continued data should be below each line in the column (In Period, the second part of the date range is missing and in Statement Type, part of the string is missing -- only correct string is Row 2, Column 6)

test.jpg


Here is the code I developed so far:

Source Code:

// now add the text
contentStream.setFont(PDType1Font.HELVETICA, 10);

float textx = margin + cellMargin;
float texty = tableTop - 15;
for (int i = 0; i < content.size(); i++) {
if (i + 1 == content.size()) {
contentStream.setNonStrokingColor(Color.black);
contentStream.setFont(PDType1Font.HELVETICA_BOLD, 12);
}
for (int j = 0; j < content.get(i).size(); j++) {
String text = content.get(i).get(j);
System.out.println("Row:"+j+",column:"+i+",data:"+ text); //DEBUG
String[] split = text.split(" ");
//if text with more than 3 words I have to slit 2 per 2
if (split.length >= 3) {
float y = texty;
float x = textx;
for (int k = 0; k + 1 < split.length; k = k + 2) {
addText(contentStream, x, y, split[k] + " "
+ split[k + 1]);
y -= 10;
}

} else {
addText(contentStream, textx, texty, text);

}
textx += sizes[j] * tableWidth / totalColWidth;
}
texty -= rowHeight;
textx = margin + cellMargin;
}

DEBUG OUTPUT (Information the PDF should be displaying):

Row:0,column:0,data:ID
Row:1,column:0,dataeriod
Row:2,column:0,data:StatementType
Row:3,column:0,data:Balance
Row:4,column:0,data:Updatedat
Row:5,column:0,data:Operator
Row:6,column:0,data:Status
Row:7,column:0,data:Email
Row:8,column:0,data:Fax
Row:9,column:0,data:QBsInvoice
Row:0,column:1,data:5454361
Row:1,column:1,data:09/01/2012 - 10/13/2012
Row:2,column:1,data:000100 (USE ACCOUNT 500): Account
Row:3,column:1,data:3000.0
Row:4,column:1,data:5.11.12
Row:5,column:1,dataror
Row:6,column:1,data:Attached
Row:7,column:1,data:Sent
Row:8,column:1,data:Sent
Row:9,column:1,data:4813-9/Open
Row:0,column:2,data:5454356
Row:1,column:2,data:07/01/2012 - 08/13/2012
Row:2,column:2,data:000100 (USE ACCOUNT 500): Account
Row:3,column:2,data:2000.0
Row:4,column:2,data:5.6.12
Row:5,column:2,dataror
Row:6,column:2,dataaid
Row:7,column:2,data:Sent
Row:8,column:2,data:Sent
Row:9,column:2,data:4813-4/Paid
Row:0,column:3,data:5454357
Row:1,column:3,data:03/01/2012 - 08/13/2012
Row:2,column:3,data:TA0087 (BROWNELL TRAVEL): Travel Agency
Row:3,column:3,data:5000.0
Row:4,column:3,data:5.7.12
Row:5,column:3,data:System(8695)
Row:6,column:3,data:Failed
Row:7,column:3,data:Sent
Row:8,column:3,data:Sent
Row:9,column:3,data:4813-5/Open
Row:0,column:4,data:5454358
Row:1,column:4,data:03/01/2012 - 08/13/2012
Row:2,column:4,data:115460 (PROTRAVEL): Account Referral
Row:3,column:4,data:7000.0
Row:4,column:4,data:5.8.12
Row:5,column:4,data:System(8695)
Row:6,column:4,data:Cancelled
Row:7,column:4,data:Sent
Row:8,column:4,data:Sent
Row:9,column:4,data:4813-6/Cancelled
Row:0,column:5,data:5454359
Row:1,column:5,data:03/01/2012 - 08/13/2012
Row:2,column:5,data:LOSB05 (COACH MAX CORPORATION): Affiliate
Row:3,column:5,data:1000.0
Row:4,column:5,data:5.9.12
Row:5,column:5,dataror
Row:6,column:5,data:Attached
Row:7,column:5,data:Sent
Row:8,column:5,data:Sent
Row:9,column:5,data:4813-7/Open
Row:0,column:6,data:5454360
Row:1,column:6,data:03/01/2012 - 08/13/2012
Row:2,column:6,data:LOSB05 (COACH MAX CORPORATION): Owner Operator
Row:3,column:6,data:2000.0
Row:4,column:6,data:5.10.12
Row:5,column:6,dataror
Row:6,column:6,data:Attached
Row:7,column:6,data:Sent
Row:8,column:6,data:Sent
Row:9,column:6,data:4813-8/Open
Row:0,column:7,data:
Row:1,column:7,data:
Row:2,column:7,data:
Row:3,column:7,data:
Row:4,column:7,data:
Row:5,column:7,data:
Row:6,column:7,data:
Row:7,column:7,data:
Row:8,column:7,data:
Row:9,column:7,data:
Done