convert column size to font size

convert column size to font size

Forum member · Apr 14, 2011
I am creating a table with several columns. the columns are set to certain widths. which takes up the whole page. what I want to do is cut off the length of the text I'm putting in the column so that it will fit. because I know that if there is to much text for the column it can create problem with stuff moving or not showing. So is there a function or something to be able to find out given a font sized used how much with fit into a column that say is set to 25. for example tble.columns.add(25) row.cells.add(left("last name",25), Font.Helvetica, 7) I know if you take 25 it will be larger than the column(25)

Re: convert column size to font size

Support · Apr 15, 2011
Hello, You can use the following method to determine the width of the text at a specified font size. ceTe.DynamicPDF.Font.Helvetica.GetTextWidth("Hello World", 15); Thanks, ceTe Software Support Team.