To use different versions of PowerPoint document easier, Spire.Presentation enables to convert PowerPoint Presentation 97 – 2003 to PowerPoint Presentation 2007, 2010. Spire.Presentation supports to convert PPT to PPTX, from version 2.2.17, now it starts to load .pps format document and save to .ppsx format document in C#. This article will show you how to convert PPS to PPTX in C#.

Step 1: Create a presentation document.

Presentation presentation = new Presentation();

Step 2: Load the PPS file from disk.

presentation.LoadFromFile("sample.pps");

Step 3: Save the PPS document to PPTX file format.

presentation.SaveToFile("ToPPTX.pptx", FileFormat.Pptx2010);

Step 4: Launch and view the resulted PPTX file.

System.Diagnostics.Process.Start("ToPPTX.pptx");

Full codes:

C#
using Spire.Presentation;
namespace PPStoPPTX
{
    class Program
    {
        static void Main(string[] args)
        {
            Presentation presentation = new Presentation();

            //load the PPS file from disk
            presentation.LoadFromFile("sample.pps");

            //save the PPS document to PPTX file format
            presentation.SaveToFile("ToPPTX.pptx", FileFormat.Pptx2010);
            System.Diagnostics.Process.Start("ToPPTX.pptx");
        }
    }
}
VB.NET
Imports Spire.Presentation
Namespace PPStoPPTX
	Class Program
		Private Shared Sub Main(args As String())
			Dim presentation As New Presentation()

			'load the PPS file from disk
			presentation.LoadFromFile("sample.pps")

			'save the PPS document to PPTX file format
			presentation.SaveToFile("ToPPTX.pptx", FileFormat.Pptx2010)
			System.Diagnostics.Process.Start("ToPPTX.pptx")
		End Sub
	End Class
End Namespace

The result PPTX document:

How to convert PPS document to PPTX in C#

Outline and effects for shapes can make the presentation of your PowerPoint files more attractive. This article talks about how to set the outline and effects for shapes via Spire.Presentation.

Step 1: Create a PowerPoint document.

Presentation ppt = new Presentation();

Step 2: Get the first slide

ISlide slide = ppt.Slides[0];

Step 3: Draw Rectangle shape on slide[0] with methord AppendShape();

IAutoShape shape = slide.Shapes.AppendShape(ShapeType.Rectangle, new RectangleF(50, 100, 100, 50));

Step 4: Set outline color as red.

//Outline color
shape.ShapeStyle.LineColor.Color = Color.Red;

Step 5: Add shadow effect and set parameters for it.

//Effect
PresetShadow shadow = new PresetShadow();
shadow.Preset = PresetShadowValue.FrontRightPerspective;
shadow.Distance = 10.0;
shadow.Direction = 225.0f;
shape.EffectDag.PresetShadowEffect = shadow;

Step 6: Change a Ellipse to add yellow outline with a glow effect:

Change step 4 and 5 as Code:

shape = slide.Shapes.AppendShape(ShapeType.Ellipse, new RectangleF(200, 100, 100, 100));
//Outline color
shape.ShapeStyle.LineColor.Color = Color.Yellow;
//Effect
GlowEffect glow = new GlowEffect();
glow.ColorFormat.Color = Color.Purple;
glow.Radius = 20.0;
shape.EffectDag.GlowEffect = glow;

Step 7: Save and review.

ppt.SaveToFile("Result.pptx", FileFormat.Pptx2010);
System.Diagnostics.Process.Start("Sample.PPTx");

Here is the screen shot:

Set the outline and effects for shapes in PowerPoint files via Spire.Presentation

In some circumstance where we need to create a copy of the existing pages in our PDF document instead of copying the entire file, in particular, if we have to create hundreds copies of a certain page, it can be tedious to copy the page one after another. This article demonstrates a solution for how to duplicate a page in a PDF document and create multiple copies at a time using Spire.PDF.

In this example, I prepare a sample PDF file that only contains one page and eventually I’ll create ten copies of this page in the same document. Main method would be as follows:

Code Snippet:

Step 1: Create a new PDF document and load the sample file.

PdfDocument pdf = new PdfDocument("Sample.pdf");

Step 2: Get the first page from PDF, get the size of the page. Create a new instance of Pdf Template object based on the content and appearance of the first page.

PdfPageBase page = pdf.Pages[0];
SizeF size = page.Size;
PdfTemplate template = page.CreateTemplate();

Step 3: Create a new PDF page with the method Pages.Add() based on the size of the first page, draw the template on the new page at the specified location. Use a for loops to get more copies of this page.

for (int i = 0; i < 10; i++)
{
    page = pdf.Pages.Add(size, new PdfMargins(0));
    page.Canvas.DrawTemplate(template, new PointF(0, 0));
}

Step 4: Save the file.

pdf.SaveToFile("Result.pdf");

Output:

Ten copies of the first page have been created in the sample PDF document.

How to Duplicate a Page within a PDF Document in C#, VB.NET

Full Code:

[C#]
using Spire.Pdf;
using Spire.Pdf.Graphics;
using System.Drawing;

namespace DuplicatePage
{
    class Program
    {
        static void Main(string[] args)
        {
            PdfDocument pdf = new PdfDocument("Sample.pdf");

            PdfPageBase page = pdf.Pages[0];
            SizeF size = page.Size;
            PdfTemplate template = page.CreateTemplate();

            for (int i = 0; i < 10; i++)
            {
                page = pdf.Pages.Add(size, new PdfMargins(0));
                page.Canvas.DrawTemplate(template, new PointF(0, 0));
            }
            pdf.SaveToFile("Result.pdf");
        }
    }
}
[VB.NET]
Imports Spire.Pdf
Imports Spire.Pdf.Graphics
Imports System.Drawing

Namespace DuplicatePage
	Class Program
		Private Shared Sub Main(args As String())
			Dim pdf As New PdfDocument("Sample.pdf")

			Dim page As PdfPageBase = pdf.Pages(0)
			Dim size As SizeF = page.Size
			Dim template As PdfTemplate = page.CreateTemplate()

			For i As Integer = 0 To 9
				page = pdf.Pages.Add(size, New PdfMargins(0))
				page.Canvas.DrawTemplate(template, New PointF(0, 0))
			Next
			pdf.SaveToFile("Result.pdf")
		End Sub
	End Class
End Namespace
page 247