Interface IPresentationRenderer
Represents a .Core Renderer engine to convert the slide to image
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Portable.dll
Syntax
public interface IPresentationRenderer
Properties
ExportChartImageOptions
Gets or sets ChartRenderingOptions for charts present in the Word document. By Default ScalingMode is set to Best and ExportImageFormat is set to Jpeg.
Declaration
ChartRenderingOptions ExportChartImageOptions { get; set; }
Property Value
Type | Description |
---|---|
ChartRenderingOptions | If not initialized and specified, Default values Jpeg and Best will be set. |
Remarks
Set this property to control the Quality of the charts in the PowerPoint chart to Image and PDF convers.
Examples
This example illustrates AutoDetectComplexScript property of DocIORenderer settings.
//Open a PowerPoint presentation
IPresentation presentation = Presentation.Open("Sample.pptx");
//Initialize the PresentationRenderer
PresentationRenderer renderer = new PresentationRenderer();
renderer.ExportChartImageOptions = new ChartRenderingOptions() { ScalingMode = ScalingMode.Best,ImageFormat = Syncfusion.OfficeChart.ExportImageFormat.Jpeg };
presentation.PresentationRenderer = renderer;
//Gets the first instance of chart from slide
IPresentationChart chart=presentation.Slides[0].Charts[0];
// Converts the chart to image.
Stream image = new FileStream("Sample.png", FileMode.Create, FileAccess.ReadWrite);
renderer.ConvertToImage(chart, image);
//Close the PowerPoint presentation
presentation.Close();
Methods
ConvertToImage(IPresentationChart, Stream)
Converts the chart to image.
Declaration
void ConvertToImage(IPresentationChart chart, Stream outputStream)
Parameters
Type | Name | Description |
---|---|---|
IPresentationChart | chart | Represent the chart that convert to image |
System.IO.Stream | outputStream | Represent the stream |
Examples
//Open a PowerPoint presentation
IPresentation presentation = Presentation.Open("Sample.pptx");
//Initialize the PresentationRenderer
presentation.PresentationRenderer = new PresentationRenderer();
//Gets the first instance of chart from slide
IPresentationChart chart=presentation.Slides[0].Charts[0];
// Converts the chart to image.
Stream image = new FileStream("Sample.png", FileMode.Create, FileAccess.ReadWrite);
presentation.PresentationRenderer.ConvertToImage(chart, image);
//Close the PowerPoint presentation
presentation.Close();
ConvertToImage(ISlide, ExportImageFormat)
Converts the slide to image.
Declaration
Stream ConvertToImage(ISlide slide, ExportImageFormat imageFormat)
Parameters
Type | Name | Description |
---|---|---|
ISlide | slide | Represent the slide that convert to image |
ExportImageFormat | imageFormat | Represent the output image format |
Returns
Type | Description |
---|---|
System.IO.Stream | Return the converted image stream |
Examples
//Open a PowerPoint presentation
IPresentation presentation = Presentation.Open("Sample.pptx");
//Convert the slides to images
Stream stream = presentation.Slides[0].ConvertToImage(presentation.Slides[0], ExportImageFormat.Jpeg);
//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 stream As Stream = presentation__1.Slides(0).ConvertToImage(presentation.Slides(0), ExportImageFormat.Jpeg)
'Close the PowerPoint presentation
presentation__1.Close()