menu

Document Processing

Interface ISlide - FileFormats API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface ISlide

    Represents the slide in the presentation.

    Inherited Members
    IBaseSlide.Background
    IBaseSlide.Charts
    IBaseSlide.Find(Regex)
    IBaseSlide.Find(String, Boolean, Boolean)
    IBaseSlide.FindAll(Regex)
    IBaseSlide.FindAll(String, Boolean, Boolean)
    IBaseSlide.GroupShapes
    IBaseSlide.HeadersFooters
    IBaseSlide.Name
    IBaseSlide.Pictures
    IBaseSlide.Shapes
    IBaseSlide.SlideSize
    IBaseSlide.SlideTransition
    IBaseSlide.Tables
    IBaseSlide.Timeline
    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface ISlide : IBaseSlide

    Properties

    Comments

    Returns the collection of slide comments. Read-only.

    Declaration
    IComments Comments { get; }
    Property Value
    Type
    IComments
    Examples
    //Create a new presentation.
    IPresentation presDoc = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
    //Add a text box to the slide
    IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
    //Add a paragraph to the textbody of the shape
    shape.TextBody.AddParagraph("Hi Syncfusion Customers");
    //Add a comment to the slide
    IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
    //Author2 add reply to a parent comment
    slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);             
    //Get the collection of the comments
    IComments comments = slide.Comments;
    //Save the presentation to the file system.
    presDoc.Save("Output.pptx");
    //Close the presentation
    presDoc.Close();
         
     Dim presDoc As IPresentation = Presentation.Create()
     ‘Add slide to the presentation
     Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
     ‘Add table to the slide
     Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
     'Add a text box to the slide
     Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
     'Add a paragraph to the text body of the shape
     shape.TextBody.AddParagraph()
     'Add a comment to the slide
     Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
     'Author2 add reply to a parent comment
     slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);             
     'Get the collection of the comments
     Dim comments As IComments = slide.Comments;
     ‘Save the presentation
     presDoc.Save("Sample.pptx")
     ‘Close the presentation
     presDoc.Close()

    LayoutSlide

    Gets the layout slide instance of current slide.

    Declaration
    ILayoutSlide LayoutSlide { get; }
    Property Value
    Type
    ILayoutSlide

    NotesSlide

    Gets the current notes slide instance. Returns null if no notes are present.

    Declaration
    INotesSlide NotesSlide { get; }
    Property Value
    Type
    INotesSlide

    Section

    Returns the section instance of the slide. Read-only.

    Declaration
    ISection Section { get; }
    Property Value
    Type
    ISection

    SlideID

    Gets the Unique ID for the current slide. Read-only. The Unique ID ranges from 256 to 2147483647.

    Declaration
    uint SlideID { get; }
    Property Value
    Type
    System.UInt32

    SlideNumber

    Gets the number of the current slide. Read-only.

    Declaration
    int SlideNumber { get; }
    Property Value
    Type
    System.Int32

    Visible

    Gets or sets the boolean value which indicates whether the slide is visible or not.

    Declaration
    bool Visible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this slide instance is visible; otherwise, false.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Hide the slide in presentation
    slide.Visible = false;
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a blank slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Hide the slide in presentation
    slide.Visible = False
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    Methods

    AddNotesSlide()

    Adds a new notes to the slide.

    Declaration
    INotesSlide AddNotesSlide()
    Returns
    Type Description
    INotesSlide

    Returns the notes slide of INotesSlide instance.

    AddTextBox(Double, Double, Double, Double)

    Adds a text box to the slide.

    Declaration
    IShape AddTextBox(double left, double top, double width, double height)
    Parameters
    Type Name Description
    System.Double left

    Represents the left position,in points. The Left value ranges from -169056 to 169056.

    System.Double top

    Represents the top position,in points. The Top value ranges from -169056 to 169056.

    System.Double width

    Represents the width,in points. The Width value ranges from 0 to 169056.

    System.Double height

    Represents the height,in points. The Height value ranges from 0 to 169056.

    Returns
    Type Description
    IShape

    Returns an IShape instance that represents the text box.

    Examples
     //Create a new presentation.
     IPresentation presentation = Presentation.Create();
     //Add a new slide to the presentation.
     ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
     //Add a text box to the slide.
     IShape shape = slide.AddTextBox(10, 10, 300, 350);
     //Add a paragraph with text content to the shape.
     shape.TextBody.AddParagraph("This is a new text box");
     //Save the presentation.
     presentation.Save("Slide_TextBox.pptx");
     //Close the presentation.
     presentation.Close();
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a new slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Add a text box to the slide.
    Dim shape As IShape = slide.AddTextBox(10, 10, 300, 350)
    'Add a paragraph with text content to the shape.
    shape.TextBody.AddParagraph("This is a new text box")
    'Save the presentation.
    presentation__1.Save("Slide_TextBox.pptx")
    'Close the presentation.
    presentation__1.Close()

    Clone()

    Creates an independent copy of ISlide instance.

    Declaration
    ISlide Clone()
    Returns
    Type Description
    ISlide

    Returns the cloned slide instance.

    Examples
    //Open an existing presentation.
    IPresentation presentation = Presentation.Open("Presentation.pptx");
    //Retrieve the slide instance.
    ISlide slide = presentation.Slides[0];
    //Create a cloned copy of slide.
    ISlide slideClone = slide.Clone();
    //Add a new text box to the cloned slide.
    IShape textboxShape = slideClone.AddTextBox(0, 0, 250, 250);
    //Add a paragraph with text content to the shape.
    textboxShape.TextBody.AddParagraph("Hello Presentation");
    //Add the slide to the presentation.
    presentation.Slides.Add(slideClone);
    //Save the presentation to the file system.
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    'Open an existing presentation.
    Dim presentation__1 As IPresentation = Presentation.Open("Presentation.pptx")
    'Retrieve the slide instance.
    Dim slide As ISlide = presentation__1.Slides(0)
    'Create a cloned copy of slide.
    Dim slideClone As ISlide = slide.Clone()
    'Add a new text box to the cloned slide.
    Dim textboxShape As IShape = slideClone.AddTextBox(0, 0, 250, 250)
    'Add a paragraph with text content to the shape.
    textboxShape.TextBody.AddParagraph("Hello Presentation")
    'Add the slide to the presentation.
    presentation__1.Slides.Add(slideClone)
    'Save the presentation to the file system.
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    ConvertToImage(ImageFormat)

    Converts the slide to image.

    Declaration
    Stream ConvertToImage(ImageFormat imageFormat)
    Parameters
    Type Name Description
    ImageFormat imageFormat

    Specifies the image format to convert the slide.

    Returns
    Type Description
    System.IO.Stream

    Returns a stream instance that represents the converted slide.

    Examples
    //Create a presentation.
    IPresentation presentation = Presentation.Open("Input.pptx");
    //Create instance for chart to image converter
    presentation.ChartToImageConverter = new ChartToImageConverter();
    //Set the scaling mode
    presentation.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best;
    //Retrieve the first slide from presentation
    ISlide slide = presentation.Slides[0];
    //Convert slide to image
    Image image = Image.FromStream(slide.ConvertToImage(Syncfusion.Drawing.ImageFormat.Emf));            
    //Save the presentation
    presentation.Save("Sample.pptx");
    //Close the presentation
    presentation.Close();
    'Create a presentation.
    Dim presentation__1 As IPresentation = Presentation.Open("Input.pptx")
    'Create instance for chart to image converter
    presentation__1.ChartToImageConverter = New ChartToImageConverter()
    'Set the scaling mode
    presentation__1.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Best
    'Retrieve the first slide from presentation
    Dim slide As ISlide = presentation__1.Slides(0)
    'Convert slide to image
    Dim image__2 As Image = Image.FromStream(slide.ConvertToImage(Syncfusion.Drawing.ImageFormat.Emf))
    'Save the presentation
    presentation__1.Save("Sample.pptx")
    'Close the presentation
    presentation__1.Close()

    ConvertToImage(ImageType)

    Converts the slide to image.

    Declaration
    Image ConvertToImage(ImageType imageType)
    Parameters
    Type Name Description
    ImageType imageType

    Specifies the image type to convert the slide.

    Returns
    Type Description
    System.Drawing.Image

    Returns an image instance that represents the converted slide.

    Examples
    //Open a PowerPoint presentation
    IPresentation presentation = Presentation.Open("Sample.pptx");
    //Convert the slides to images
    System.Drawing.Image[] images = presentation.RenderAsImages(Syncfusion.Drawing.ImageType.Bitmap);
    //Close the PowerPoint presentation
    presentation.Close();
    'Open a PowerPoint presentation
    Dim presentation__1 As IPresentation = Presentation.Open("Sample.pptx")
    'Convert the slides to images
    Dim images As Image() = presentation__1.RenderAsImages(Syncfusion.Drawing. ImageType.Bitmap)
    'Close the PowerPoint presentation
    presentation__1.Close()

    MoveToSection(Int32)

    Moves the slide to the start of the specified section index.

    Declaration
    void MoveToSection(int sectionIndex)
    Parameters
    Type Name Description
    System.Int32 sectionIndex

    Specifies the section index to be moved.

    RemoveNotesSlide()

    Removes the notes slide.

    Declaration
    void RemoveNotesSlide()
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »