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 Jun 12, 2019 3:33 pm

Hello,

I am trying to use the Spire.Presentation library to align 2 tables vertically at the bottom. See the attached image. Essentially we are trying to replicate the Arrange > Align > Align Bottom Powerpoint feature. I cannot seem to find a way to do this in the library
You do not have the required permissions to view the files attached to this post.

csallemi
 
Posts: 2
Joined: Mon May 15, 2017 8:07 pm

Thu Jun 13, 2019 11:05 am

Hi,

Thanks for your inquiry.
Sorry there is no available property to align table to bottom in our Spire.Presentation at present, we will consider adding this feature to our upgrade list. If the feature is finished, we will inform you. As a workaround, you can achieve the same effect by setting the top coordinate of the table. Below is the sample code.
Code: Select all
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("Sample.pptx");
            ITable table = null;
            foreach (IShape shape in ppt.Slides[0].Shapes)
            {
                if (shape is ITable)
                {
                    table = (ITable)shape;
                    table.Top = ppt.SlideSize.Size.Height-table.Height;
                }
            }
            ppt.SaveToFile("Result.pptx", FileFormat.Pptx2010);

Sincerely,
Nancy
E-iceblue support team
User avatar

nancy.yang
 
Posts: 184
Joined: Wed Apr 03, 2019 2:33 am

Thu Jul 04, 2019 10:16 am

Hi,

Thanks for your patient waiting.
Glad to notify you that the feature is available now, please download the release Spire.Presentation Pack Version:4.7 and use the following code to align the table to bottom.
Code: Select all
Presentation ppt = new Presentation();
ppt.LoadFromFile("Table.pptx");
ITable table = null;
foreach (IShape shape in ppt.Slides[0].Shapes)
{
    if (shape is ITable)
    {
        table = (ITable)shape;
        table.SetShapeAlignment(Spire.Presentation.ShapeAlignment.AlignBottom);
    }
}
ppt.SaveToFile("Result.pptx", FileFormat.Pptx2013);
Sincerely,
Nina
E-iceblue support team
User avatar

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

Mon Jul 22, 2019 7:12 am

Hi,

Greetings from E-iceblue.
Did we fix your issue?
Thanks in advance for your valuable feedback and time.

Sincerely,
Nina
E-iceblue support team
User avatar

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

Return to Spire.Presentation