We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to enable text wrap?

I have a Aspose.Pdf.Table which in turn has cells and some data being displayed in the cells.

The problem here is that i have fixed the widths of the columns of the tabel using table.ColumnWidths property. Now if a text (a complete word) is such that it cannot be displayed within the column width than that text is broken and the remaining part is displayed in the next line.

Is there any property by which I can set the wrap property to true and hence it shall display wrap the text in a new line instead of breaking it. And infact if the text cannot be accomodated in the column width than the column width should increase automatically.

Please respond asap.

Hello Aneesh,

Thanks for considering Aspose.

Table class has a method named SetColumnWidth which is used to adjust the column width. Regarding your query to automatically increase the column width, based on its contents, please use the method named public float GetMinColumnWidth(Pdf,int);

[C#]

tab1.SetColumnWidth(2, tab1.GetMinColumnWidth(pdf, 2)); //where 2 is the column number for which you need to adjust the width

If it does not satisfy your requirement and you face any problem, please feel free to share.

Hi,

Thanks, the problem is now solved.