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

Free Support Forum - aspose.com

Get width of a table

Hello is their any way to get width of a table.

I am using nested table.
Setup is as follows.
first table is 2*2 in that in
1st row 1t column cell is empty
all other cells contain one table each.

in this scenario if i set column adjustment property to auto fit to content all data will go to one corner as first row first cell is empty.

now i want to set width of first column to be same as width of table in second row first column.
how i will be able to do that.

Hi Sameer,

Thanks for your inquriy. I am afraid currently Aspose.Pdf does not support to calculate table/cell width. We have already logged a ticket PDFNET-40994 for the feature. We have linked your post to the issue and will notify you as soon as it is implemented.

We are sorry for the inconvenience.

Best Regards,
Hi Sameer,

Thanks for your inquiry. We have good news for you, your above reported issue PDFNET-40994 has been resolved, its fix will be included in upcoming release i.e. 17.3.0. We have implemented GetWidth() method in Table class, it will help you to get table width. Hopefully, Aspose.Pdf for .NET 17.3.0 will be published in next couple of days. However we will also notify you as soon as it is published and gets available for download.

Aspose.Pdf.Table table = new Aspose.Pdf.Table();

table.ColumnAdjustment = ColumnAdjustment.AutoFitToContent;

Aspose.Pdf.Row row = table.Rows.Add();

Aspose.Pdf.Cell cell = row.Cells.Add("Cell 1 text");

cell = row.Cells.Add("Cell 2 text");

Assert.IsTrue(table.GetWidth() == 88.94);

Best Regards,

The issues you have found earlier (filed as PDFNET-40994) have been fixed in Aspose.Pdf for .NET 17.3.0.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.