Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents from any .NET(C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Wed Jan 31, 2018 2:54 pm

Hi guys,

I'm trying to align text inside cell to bottom, however cannot achieve that.
Please check my code snippet and screenshot (1st - is what i want, 2nd is what i get):

Code: Select all
        static void Main(string[] args)
        {
            var presentation = new Presentation();

            var halfSize = (presentation.SlideSize.Size.Width / 2) - 40;
            var columnWidth = halfSize / 4;

            Double[] widths = new double[] { columnWidth, columnWidth, columnWidth, columnWidth };
            Double[] heights = new double[] { 100, 30, 50 };

            ITable table = presentation.Slides[0].Shapes.AppendTable(20, 80, widths, heights);
            table.StylePreset = TableStylePreset.NoStyleTableGrid;


            table.MergeCells(table[0, 0], table[1, 0], false);
            table.MergeCells(table[0, 0], table[2, 0], false);
            table.MergeCells(table[0, 0], table[3, 0], false);

            table[0, 0].TextFrame.Text = "Void";
            table[0, 0].TextFrame.Paragraphs[0].Alignment = TextAlignmentType.Center;
            table[0, 0].TextFrame.Paragraphs[0].FirstTextRange.FontHeight = 28;

            //This line seems not working
            table[0, 0].TextFrame.AnchoringType = TextAnchorType.Bottom; 

            presentation.SaveToFile("D://test.pptx", FileFormat.Pptx2013);

            Process.Start("D://test.pptx");
        }
You do not have the required permissions to view the files attached to this post.

Stecya
 
Posts: 27
Joined: Wed Jan 10, 2018 2:36 pm

Thu Feb 01, 2018 2:21 am

Hello,

Thanks for your inquiry.
Please change your code to :
Code: Select all
table[0, 0].TextAnchorType = TextAnchorType.Bottom;

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1031
Joined: Tue Sep 27, 2016 1:06 am

Thu Feb 01, 2018 8:28 am

Thanks,

Works as expected.

Stecya
 
Posts: 27
Joined: Wed Jan 10, 2018 2:36 pm

Thu Feb 01, 2018 8:33 am

Hi,

Thanks for your feedback.
If you need other assistance, please feel free to contact us.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1031
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Presentation