Interface ISlide
Represents the slide in the presentation.
Inherited Members
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Portable.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 |
|
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(ExportImageFormat)
Converts the slide to image in .Net Core.
Declaration
Stream ConvertToImage(ExportImageFormat imageFormat)
Parameters
Type | Name | Description |
---|---|---|
ExportImageFormat | 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");
//Retrieve the first slide from presentation
ISlide slide = presentation.Slides[0];
//Convert slide to image
Image image = Image.FromStream(slide.ConvertToImage(ExportImageFormat.Png));
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a presentation.
Dim presentation__1 As IPresentation = Presentation.Open("Input.pptx")
'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(ExportImageFormat.Png))
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the 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()