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
SlideAn object of a slide
Create(string)
Static method to instantiate a new object of Presentation class.
public static Presentation Create(string FilePath)
Parameters
FilePath
stringPresentation 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
CommentAuthorPass comment author object
ExtractAndSaveImages(string)
Extract and save images of a presentation into a director
public void ExtractAndSaveImages(string outputFolder)
Parameters
outputFolder
stringFolder path as string
GetCommentAuthors()
Get the list of comment author
public List<CommentAuthor> GetCommentAuthors()
Returns
GetSlides()
Method to get the list of all slides of a presentation
public List<Slide> GetSlides()
Returns
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
Open(string)
Static method to load an existing presentation.
public static Presentation Open(string FilePath)
Parameters
FilePath
stringPresentation path as string
Returns
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
intIndex of a slide
Returns
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
stringFile path where to save TXT file