Hello.
Hi Stian,
Thanks for your interest in Aspose.Slides.
Well, our conversation was regarding some older versions of Aspose.Slides. In the recent versions, we have margin properties associated with a TextFrame like MarginTop, MarginBottom, MarginLeft, MarginRight. Here is an example how to use these properties for text alignment purpose in a TextFrame.
Presentation pres = new Presentation();
Slide sld = pres.GetSlideByPosition(1);
Aspose.Slides.Table tbl= sld.Shapes.AddTable(50, 50, 3000, 1000, 3, 3);
Aspose.Slides.Cell cell= tbl.GetCell(0, 0);
TextFrame tf = cell.TextFrame;
tf.MarginTop = 0;
tf.Text = "Top";
pres.Write("pptTableAspose.ppt");
Hope this will be helpful.
Best Regards
Yes, I know about Margin, but my problem is getting the text bottom aligned. The height of the row/cells is variable based on how many columns, and what the text is in each column. This causes very high columns, with some texts being short. And the short texts will be aligned in the top with a big space under.
Here you can see the problem I am facing. I have censored the text only. I want all the headers to be bottom aligned. “Deltager” and “Ligger…” looks very stupid up there.
Hi Stian,
Thanks for your interest in Aspose.Slides.
Well, TextFrame object exposes AnchorText property, that can be used for vertical alignment. An example for this is as under:
Presentation pres = new Presentation();
Slide sld = pres.GetSlideByPosition(1);
Aspose.Slides.Table tbl= sld.Shapes.AddTable(50, 50, 3000, 1000,10, 40);
Aspose.Slides.Cell cell= tbl.GetCell(0, 0);
TextFrame tf = cell.TextFrame;
tf.Text = "Bottom";
tf.Paragraphs[0].Portions[0].FontHeight = 8;
tf.AnchorText = AnchorText.Bottom;
pres.Write("pptTableAspose.ppt");
Best Regards