Table of Contents

Class Presentation

Namespace
FileFormat.Slides
Assembly
FileFormat.Slides.dll

Represents the presentation document.

public class Presentation
Inheritance
Presentation
Inherited Members

Properties

Facade

public PresentationDocumentFacade Facade { get; }

Property Value

PresentationDocumentFacade

Methods

AppendSlide(Slide)

This method is responsible to append a slide.

public void AppendSlide(Slide slide)

Parameters

slide Slide

An object of a slide

Create(string)

Static method to instantiate a new object of Presentation class.

public static Presentation Create(string FilePath)

Parameters

FilePath string

Presentation path as string

Returns

Presentation

An instance of Presentation object

Examples

Presentation presentation = Presentation.Create("D:\\AsposeSampleResults\\test2.pptx");
TextShape shape = new TextShape();
shape.Text = "Title: Here is my first title From FF";
TextShape shape2 = new TextShape();
shape2.Text = "Body : Here is my first title From FF";
 // First slide
Slide slide = new Slide();
slide.AddTextShapes(shape);
slide.AddTextShapes(shape2);
// 2nd slide
Slide slide1 = new Slide();
slide1.AddTextShapes(shape);
slide1.AddTextShapes(shape2);
// Adding slides
presentation.AppendSlide(slide);
presentation.AppendSlide(slide1);
presentation.Save();

CreateAuthor(CommentAuthor)

Create comment author using this method

public void CreateAuthor(CommentAuthor author)

Parameters

author CommentAuthor

Pass comment author object

ExtractAndSaveImages(string)

Extract and save images of a presentation into a director

public void ExtractAndSaveImages(string outputFolder)

Parameters

outputFolder string

Folder path as string

GetCommentAuthors()

Get the list of comment author

public List<CommentAuthor> GetCommentAuthors()

Returns

List<CommentAuthor>

GetSlides()

Method to get the list of all slides of a presentation

public List<Slide> GetSlides()

Returns

List<Slide>

Examples

Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
var slides = presentation.GetSlides();
var slide = slides[0];
...

InsertSlideAt(int, Slide)

Method to insert a slide at a specific index

public void InsertSlideAt(int index, Slide slide)

Parameters

index int

Index of a slide

slide Slide

A slide object

Open(string)

Static method to load an existing presentation.

public static Presentation Open(string FilePath)

Parameters

FilePath string

Presentation path as string

Returns

Presentation

Examples

Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
TextShape shape1 = new TextShape();
shape1.Text = "Title: Here is my first title From FF";
TextShape shape2 = new TextShape();
shape2.Text = "Body : Here is my first title From FF";
 // New slide
Slide slide = new Slide();
slide.AddTextShapes(shape1);
slide.AddTextShapes(shape2);       
// Adding slide
presentation.AppendSlide(slide);
presentation.Save();

RemoveCommentAuthor(CommentAuthor)

Method to remove comment author.

public void RemoveCommentAuthor(CommentAuthor author)

Parameters

author CommentAuthor

RemoveSlide(int)

Method to remove a slide at a specific index

public string RemoveSlide(int slideIndex)

Parameters

slideIndex int

Index of a slide

Returns

string

Examples

Presentation presentation = Presentation.Open("D:\\AsposeSampleData\\sample.pptx");
var confirmation = presentation.RemoveSlide(0);
Console.WriteLine(confirmation);
presentation.Save();

Save()

Method to save the new or changed presentation.

public void Save()

SaveAllNotesToTextFile(string)

This method exports all existing notes of a PPT/PPTX to TXT file.

public void SaveAllNotesToTextFile(string filePath)

Parameters

filePath string

File path where to save TXT file