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

Free Support Forum - aspose.com

Returned Table and Cell padding values are incorrect

Hello,

We’re currently having an issue regarding the returned values for the Table and Cell padding properties, which are 0 instead of actual values displayed by MS Word… We tested using the latest version of Aspose.Words (version 13.12.0.0).
The following code reproduces the issue; it displays the value 0 for all properties instead of the actual values (10 for top, 20 for bottom, 30 for left and 40 for right padding):

var filePath = @“testMargins.docx”;
var doc = new Document(filePath);
var table = doc.FirstSection.Body.Tables[0];

Console.WriteLine(“Table padding:”);
Console.WriteLine(table.TopPadding);
Console.WriteLine(table.BottomPadding);
Console.WriteLine(table.LeftPadding);
Console.WriteLine(table.RightPadding);

Console.WriteLine(“Top Left Cell padding:”);
var cell = table.FirstRow.FirstCell;
Console.WriteLine(cell.CellFormat.TopPadding);
Console.WriteLine(cell.CellFormat.BottomPadding);
Console.WriteLine(cell.CellFormat.LeftPadding);
Console.WriteLine(cell.CellFormat.RightPadding);

Please check the attached test file and screenshots to reproduce the issue.


Thank you!
Bogdan Rusu,
IBM Romania.

Hi Bogdan,

Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-9592. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Hello,

Do you have any updates on this one ?

Thank you,
Mihai Andrei
Sr Software Engineer
IBM Romania

Hi Mihai,


Thanks for your inquiry.

Unfortunately, your issue is not resolved yet. Our development team has completed the analysis of this issue and the root cause has been identified. However, the implementation of the fix to this issue has been postponed till a later date. We will inform you via this thread as soon as this issue is resolved. We apologize for any inconvenience.

The problem occurs because these attributes are specified through the table style. You will be able to get them using table style when accessing information of Table Styles will be available in Aspose.Words API. Moreover, as a temporary workaround, please convert formatting specified in table styles into direct formatting on tables in the document by using the Document.ExpandTableStylesToDirectFormatting Method . I hope, this helps.

Best regards,

The issues you have found earlier (filed as WORDSNET-9592) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.