Hello, I am a German trainee using iText since a few weels. I have similar problems 
like Scott Edward Skinner ... I guess I better include the code I have written ...

int groesse= headlines.size();
float[] headerwidths= new float [groesse];
for (int i = 0; i < groesse; i++)
{

String eintrag = (String) headlines.elementAt(i);
Cell cell = new Cell(""+ eintrag);
datatable.addCell(cell);
                                
BaseFont meinFont = BaseFont.createFont("Helvetica", BaseFont.CP1252, 
BaseFont.NOT_EMBEDDED);
float points = meinFont.getWidthPoint(eintrag, 14f);
float inches = points / 72f;
float cm = inches * 2.54f;
System.out.println("points: " + points + "; inches: " + inches + "; cm: " + cm);
headerwidths[i]= points;
System.out.println("Inhalt von Headerwidths an der Stelle " +i+": "+headerwidths[i]);
                
}
                        
datatable.setWidths(headerwidths);
datatable.setWidth(100); // percentage 

I`d like to have an array like in "Chap0509.java" that is -> int headerwidths[] = {10, 
24, 12, 12, 7, 7, 7, 7, 7, 7};
but with float data ... I have a Vector of headlines and I`d like to have the size of 
each column as big as every headline is.
I got the get the text width with BaseFont.getWidthPoint() but now it seems not to be 
possible to get the table in my PDF-File the way I`d like to have it.
My compiler always gets me the message: "Wrong number of columns."

What do I have to change in my code? 

I would be very thankful for help.

Bye,

Katharina Garbe




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to