IPresentation Interface
The IPresentation interface shows the presentation that is currently open. This interface can be obtained using the IPresentationConverter.Presentation property.
Table 1. Properties
Property | Value Type | Access | Property description |
---|---|---|---|
Title | string | Read/Write | The presentation title. |
SlideWidth | int | Read/Write | The slide width in pixels. |
SlideHeight | int | Read/Write | The slide height in pixels. |
XmlDescriptionFile | string | Read/Write | The path to the file where the XML-description of the presentation content will be saved. The file format is described below. |
Object | object | Read only | Returns a PowerPoint.Presentation COM object, which provides properties and methods for accessing the presentation. |
HasDefaultPresenter | bool | Read only | A Boolean value indicating whether the presentation has a default presenter. |
Presenters | IPresenters | Read only | Returns the IPresenters interface that represents a collection of presentation presenters. |
DefaultPresenter | IPresenter | Read/Write | Returns the IPresenter interface that represents information about the presentation presenter. |
Slides | ISlides | Read only | Returns the ISlides Interface that represents a collection of presentation slides. |
Table 2. Methods
Method | Method description |
---|---|
void Close() | Closes the presentation. |
void RemoveDefaultPresenter() | Removes the default presenter. |
IPresentationInfo Scan(PresentationScanMode scanMode, object slideRange) | Scan: scans the presentation for external resources. scanMode: defines which external resources should be searched for while scanning the presentation. slideRange: defines which slides should be examined in search of resources. This parameter is described in PresentationConverter.GenerateHtml5Presentation() Method. Passes empty string or null for all slides. |
C# - Scanning the presentation for external resources
using System;
using iSpring;
namespace PresentationSample
{
class Program
{
static void Main(string[] args)
{
IPresentationConverter converter = new PresentationConverter();
converter.OpenPresentation("c:\\external_videos.pptx");
IPresentationInfo presentationInfo = converter.Presentation.Scan(PresentationScanMode.PSM_DEFAULT, "0-8");
foreach (IExternalResource res in presentationInfo.ExternalResources)
{
string resType = res.Type == ExternalResourceType.ERT_VIDEO_SHAPE ? "Video" : "Audio";
string resStatus =
res.Status == ExternalResourceStatus.ERS_FOUND_BY_ABSOLUTE_PATH ? "found by absolute path" :
res.Status == ExternalResourceStatus.ERS_FOUND_BY_RELATIVE_PATH ? "found by relative path" :
"not found";
Console.WriteLine($"Resource {res.Path}\n\t{resType} {resStatus}");
Console.WriteLine();
}
}
}
}
C#
XML Description format
<?xml version="1.0"?>
<presentation title="Sample presentation" width="960.0000000" height="540.0000000" frameRate="24.0000000" duration="994.5070243">
<slides>
<slide index="1" slideId="466" animationStepsCount="1" hidden="0" advanceOnClick="1" advanceOnTime="0" duration="10.5000005" src="data/slide1.js" title="Hello World">
<notes>Slide notes</notes>
<notesHtml><i>Slide notes</i></notesHtml>
<text>Hello World</text>
</slide>
</slides>
</presentation>
CODE