Free Support Forum -

TextFrame margin is not working in the version Aspose.Slides.PPTx 4.2.0

I am using Aspose.Slides.pptx 4.2.0. In 2003 version I have used TextFrame margintop property to set the margin in the table cell. But, the same code is not working in the pptx version for office 2007.
Below is the code used.

double[] coWidths = { 60, 60, 50 };
double[] roHeights = { 40, 40, 40, 40, 40, 40 };
TableEx tableData = slide.Shapes[slide.Shapes.AddTable(chartWidth + 10, 60, coWidths, roHeights)] as TableEx;
tableData.StylePreset = TableStylePresetEx.NoStyleNoGrid;

CellEx cell = tableData.Rows[0][0];
TextFrameEx tff = cell.TextFrame;
tff.CenterText = true;
tff.MarginTop = 5;

The marginTop never applies. Please help me out. This is very important for the formatting and UI look.


I have resolved this myself. Somehow the MarginTop for TextFrameEx is not working. I have used cell.MarginTop property. It is working fine.
Sometimes naming conventions are really matters. That happen here. Margin means we are moving from parent control to the child. Padding means inside control where to start content. So, here we have cell, and inside cell I want to move 5 down and start the content there. It means it should be padding top.
Any way, I solved my problem.


Dear Praveen,

I am really pleased that you have been able to figure out the issue and make things work for you. We always appreciate positive feedback from our customers. Please feel free to share if you face any more issues.

Thanks and Regards,