Sorry here it is:
 
// Init data table
dataTableN = new PdfPTable(edition.getColonnes().size());
dataTableN.setWidthPercentage(100f);
dataTableN.setTotalWidth(100f);
 
// add title
cell = getTitreColonnes(edition);
dataTableN.addCell(cell);
 
// add lines
for (int indexLine = 0; indexLine < tableau.getLignes().size(); indexLine++) {
    ArrayList lines = (ArrayList) tableau.getLignes();
 
    // get a data line
    PdfPTable lineTable = new PdfPTable(1);
    lineTable.setTotalWidth(100f);
    String lib1 = "01234567890123";
    if (indexLine > 5) {
      lib1 = "012345678901234";
    }
    cell = new PdfPCell(new Phrase(lib1));
    lineTable.addCell(cell);
   
    // debug
    dataTableN.calculateHeightsFast();
    lineTable.calculateHeightsFast();
    float dataTableHeight = dataTableN.getTotalHeight();
    float lineTableHeight = lineTable.getTotalHeight();
    System.out.println("Line " + indexLine + ": line h=" + lineTableHeight + ", total h=" + lineTableHeight);
 
    // add the ligne into the data table
    cell = new PdfPCell(lineTable);
    cell.setColspan(edition.getColonnes().size());
    dataTableN.addCell(cell);
}
 
document.add(dataTableN);
document.newPage();
 
 
 
ER
 


Paulo Soares <[EMAIL PROTECTED]> a écrit :
If you post some code I won't have to guess.

Paulo

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Eric Rosaz
> Sent: Friday, October 06, 2006 12:15 PM
> To: [email protected]
> Subject: [iText-questions] RE : Re: height of row
>
> Ok but when i open the pdf file, it contains only one line. I
> did another test: when I put 14 caracters in the row, its
> height is 16, and when I put 15 caracters , its height is 28.
>
> I don't understand why itext calculate 2 rows for 15
> caracters instead of 1 ? I try to change de totalWidth,
> thinking that itext didn't have too much place to put the
> text in only one row, but the height didn't change.
>
> ER
>
>
>
> Paulo Soares <[EMAIL PROTECTED]>a écrit :
>
> That looks like two lines: padding = 2+2 = 4, font size = 12.
> One line = 2+2 + 12 = 16
> two lines = 2+2 + 2*12 = 28
>
> Paulo
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Eric Rosaz
> > Sent: Friday, October 06, 2006 11:13 AM
> > To: [email protected]
> > Subject: [iText-questions] height of row
> >
> > Hi,
> >
> > I read a lot of mail about the height of the row in PdfPTable
> > and I fixed some problems but I still have one.
> >
> > I had a table with 1 column and always the same thing in the
> > rows. I set a total width "tableLigne.setTotalWidth(100f);"
> > and when I write 12 caracters in the rows "dddddddddddd", the
> > height of the row is 16 and when I write 24 caracters
> > "zzzzzzzzzzzzzzzzzzzzzzzz", the height is 28.
> >
> > It's a bit hard to understand how the height is calculated, i
> > understood that it's important to set the width but I don't
> > understand how , please can you explain me what's happen?
> >
> > thks
> > ER
> >
> > ________________________________
> >
> > Découvrez un nouveau moyen de poser toutes vos questions quel
> > que soit le sujet ! Yahoo! Questions/Réponses pour partager
> > vos connaissances, vos opinions et vos expériences. Cliquez
> > ici .
> >
>
>
> 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.
>
>
> --------------------------------------------------------------
> -----------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
> chance to share your
> opinions on IT & business topics through brief surveys
> -- and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>
> ________________________________
>
> Découvrez un nouveau moyen de poser toutes vos questions quel
> que soit le sujet ! Yahoo! Questions/Réponses pour partager
> vos connaissances, vos opinions et vos expériences. Cliquez
> ici .
>


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.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions


Découvrez un nouveau moyen de poser toutes vos questions quel que soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences. Cliquez ici.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to