The transition of Slide can make presentation of PPT files more attractive. Spire.Presentation for .NET allows developers to manage or customize the slide transition of the slides. Developers can not only apply different slide transitions on the slides, but also customize the behavior of these transition.

To create simple slide transition and set speed and sound mode for transition, follow the steps below:

Step 1: Download Spire.Presentation and add references in VS.

Step 2: Create an instance of Presentation and add a new presentation file.

Presentation ppt = new Presentation();
ppt.LoadFromFile(fp.TestPath + "first_quarter_business_upd.ppt");

Step 3: There are 23 transition types can be set by Spire.Presentation, such as Circle, Cover, Plus, Push, etc. These transitions can be found in TransitionType enum.

ppt.Slides[0].SlideShowTransition.Type = TransitionType.Push;

How to set Transitions for Powerpoint files in C#

Step 4: We just applied a simple transition on the slide. Now, to make that even better and controlled, we can set the speed of the transition to create a more customized effect. Spire.Presentation offers Fast, Medium, None, Slow 4 options.

ppt.Slides[0].SlideShowTransition.Speed = TransitionSpeed.Slow;

Step 5: Set the transition sound mode such as None, StartSound, StopPreviousSound.

ppt.Slides[0].SlideShowTransition.SoundMode = TransitionSoundMode.StartSound;

Step 6: Finally write the modified presentation as a PPTX file.

ppt.SaveToFile("setTransitons.pptx", FileFormat.Pptx2010);

The PdfBorders class in Spire.PDF mainly contains three properties - DashStyle, Color and Width. By setting the value of these properties, you're able to change the appearance of grid border. In this article, I'll take color as an example to explain how to design gird border with Spire.PDF in C#.

As is shown in the following screenshot, Spire.PDF enables programmers to add color to PDF grid border as well as making the border as invisible.

Change the Color of Grid Border in PDF

Change the Color of Grid Border in PDF

Code Snippets:

Step 1: Create a new PDF document.

PdfDocument document = new PdfDocument();
PdfPageBase page=document.Pages.Add();

Step 2: Create a string array, create a 4 rows x 3 columns grid according to the length of string array. Set column width and row height.

String[] data
    = {
         "VendorName;Address;City",
         "Cacor Corporation;161 Southfield Rd;Southfield",
         "Underwater;50 N 3rd Street;Indianapolis",
         "J.W.  Luscher Mfg.;65 Addams Street;Berkely"
       };
 PdfGrid grid = new PdfGrid();
 for (int r = 0; r < data.Length; r++)
 {
     PdfGridRow row = grid.Rows.Add();
 }
 grid.Columns.Add(3);
 float width = page.Canvas.ClientSize.Width - (grid.Columns.Count + 1);
 grid.Columns[0].Width = width*0.15f;
 grid.Columns[1].Width = width * 0.15f;
 grid.Columns[2].Width = width * 0.15f;
 float height=page.Canvas.ClientSize.Height-(grid.Rows.Count+1);
 grid.Rows[0].Height = 12.5f;
 grid.Rows[1].Height = 12.5f;
 grid.Rows[2].Height = 12.5f;
 grid.Rows[3].Height = 12.5f;

Step 3: Insert data into grid.

for (int r = 0; r < data.Length; r++)
 {
     String[] rowData = data[r].Split(';');
     for (int c = 0; c < rowData.Length; c++)
     {
         grid.Rows[r].Cells[c].Value = rowData[c];
     }
 }

Step 4: Initialize a new instance of PdfBorders and set color property as LightBlue or Transparent. Apply border style to PDF grid.

PdfBorders border = new PdfBorders();
border.All = new PdfPen(Color.LightBlue);

foreach (PdfGridRow pgr in grid.Rows)
{
    foreach (PdfGridCell pgc in pgr.Cells)
    {
        pgc.Style.Borders = border;
    }
}

Step 5: Draw the grid on PDF and save the file.

PdfLayoutResult result = grid.Draw(page, new PointF(10, 30));
document.SaveToFile("result.pdf");
System.Diagnostics.Process.Start("result.pdf");

Entire Code:

using Spire.Pdf;
using Spire.Pdf.Graphics;
using Spire.Pdf.Grid;
using System;
using System.Drawing;


namespace ChangeColorofGridBorder
{
    class Program
    {
        static void Main(string[] args)
        {
            PdfDocument document = new PdfDocument();
            PdfPageBase page = document.Pages.Add();

            String[] data
               = {
        "VendorName;Address;City",
        "Cacor Corporation;161 Southfield Rd;Southfield",
        "Underwater;50 N 3rd Street;Indianapolis",
        "J.W.  Luscher Mfg.;65 Addams Street;Berkely"
      };
            PdfGrid grid = new PdfGrid();
            for (int r = 0; r < data.Length; r++)
            {
                PdfGridRow row = grid.Rows.Add();
            }
            grid.Columns.Add(3);
            float width = page.Canvas.ClientSize.Width - (grid.Columns.Count + 1);
            grid.Columns[0].Width = width * 0.15f;
            grid.Columns[1].Width = width * 0.15f;
            grid.Columns[2].Width = width * 0.15f;
            float height = page.Canvas.ClientSize.Height - (grid.Rows.Count + 1);
            grid.Rows[0].Height = 12.5f;
            grid.Rows[1].Height = 12.5f;
            grid.Rows[2].Height = 12.5f;
            grid.Rows[3].Height = 12.5f;

            //insert data to grid
            for (int r = 0; r < data.Length; r++)
            {
                String[] rowData = data[r].Split(';');
                for (int c = 0; c < rowData.Length; c++)
                {
                    grid.Rows[r].Cells[c].Value = rowData[c];
                }
            }

            grid.Rows[0].Style.Font = new PdfTrueTypeFont(new Font("Arial", 8f, FontStyle.Bold), true);

            //Set borders color to LightBule
            PdfBorders border = new PdfBorders();
            border.All = new PdfPen(Color.LightBlue);

            foreach (PdfGridRow pgr in grid.Rows)
            {
                foreach (PdfGridCell pgc in pgr.Cells)
                {
                    pgc.Style.Borders = border;
                }
            }

            PdfLayoutResult result = grid.Draw(page, new PointF(10, 30));
            document.SaveToFile("result.pdf");
            System.Diagnostics.Process.Start("result.pdf");
        }
    }
}

Spire.Presentation is a powerful and standalone .NET component which designed for developers to operate the PowerPoint documents in C# and VB.NET. Spire.Presentation enable developers to insert a new table, remove rows or columns in an existing table, and remove the whole table from the presentation slides. This article we will show you how to add a row to an existing table in presentation slide by using C# code.

Step 1: Create Presentation instance and load file.

Presentation ppt = new Presentation();
ppt.LoadFromFile("table.pptx");

Step 2: Get the table within the PowerPoint document.

ITable table = ppt.Slides[0].Shapes[4] as ITable;

Step 3: Add a new row into the PowerPoint table and set the data for the cells in the new row.

//Get the first row
TableRow row = table.TableRows[0];
//Clone the row and add it to the end of table
table.TableRows.Append(row);
int rowCount = table.TableRows.Count;
//Get the last row
TableRow lastRow = table.TableRows[rowCount - 1];
//Set new data of the first cell of last row
lastRow[0].TextFrame.Text = " The first cell";
//Set new data of the second cell of last row
lastRow[1].TextFrame.Text = " The second cell";

Step 4: Save the document and preview it.

ppt.SaveToFile("result.pptx", FileFormat.Pptx2010);
System.Diagnostics.Process.Start("result.pptx");

Effective screenshot:

How to add a row to an existing table in PowerPoint documents

Full codes:

using Spire.Presentation;

namespace AddRow
{

    class Program
    {
        static void Main(string[] args)
        {
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("table.pptx");

            ITable table = ppt.Slides[0].Shapes[4] as ITable;
            TableRow row = table.TableRows[0];
            table.TableRows.Append(row);
            int rowCount = table.TableRows.Count;
            TableRow lastRow = table.TableRows[rowCount - 1];
            lastRow[0].TextFrame.Text = "The first cell";
            lastRow[1].TextFrame.Text = "The second cell";

            ppt.SaveToFile("result.pptx", FileFormat.Pptx2010);
            System.Diagnostics.Process.Start("result.pptx");

        }
    }
}
page 261