pdf - Set Table Column width problems in iText7 -


when want create table in pdf, can use following 2 ways: first 1 failed.

method 1:

float[] columnwidths = {20, 30, 50}; table table = new table(columnwidths); 

it's failed control columnwidths method 2:

unitvalue[] unitvalue = new unitvalue[]{ unitvalue.createpercentvalue((float) 20), unitvalue.createpercentvalue((float) 30), unitvalue.createpercentvalue((float) 50)}; table table = new table(columnwidths); 

it's success! why happen?

yes, there no way scale column widths in itext 7.0.2, vernon said.

if want use directly 20, 30, , 50 points columns despite min widths shall use construction:

table table = new table(new float[] {20, 30, 50}) // in points         .setwidth(100) //100 pt         .setfixedlayout(); 

if set fixed layout must set width well, required fixed layout.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -