Skip to content

Commit f4d4964

Browse files
Updated GitHub for FT samples
1 parent 383c812 commit f4d4964

File tree

2 files changed

+8
-10
lines changed
  • PPTX-to-Image-conversion
    • Convert-PowerPoint-presentation-to-Image/.NET/Convert-PowerPoint-presentation-to-Image
    • Convert-PowerPoint-slide-to-Image/.NET/Convert-PowerPoint-slide-to-Image

2 files changed

+8
-10
lines changed

PPTX-to-Image-conversion/Convert-PowerPoint-presentation-to-Image/.NET/Convert-PowerPoint-presentation-to-Image/Program.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ static void Main(string[] args)
1414
//Open the existing PowerPoint presentation.
1515
using (IPresentation pptxDoc = Presentation.Open(fileStream))
1616
{
17-
//Initialize the PresentationRenderer to perform image conversion.
17+
//Initialize PresentationRenderer.
1818
pptxDoc.PresentationRenderer = new PresentationRenderer();
1919
//Convert PowerPoint to image as stream.
2020
Stream[] images = pptxDoc.RenderAsImages(ExportImageFormat.Jpeg);
21-
//Saves the images to file system
21+
//Save the images to file.
2222
for (int i = 0; i < images.Length; i++)
2323
{
2424
using (Stream stream = images[i])
2525
{
26-
//Create the output image file stream
26+
//Save the image stream to a file.
2727
using (FileStream fileStreamOutput = File.Create(Path.GetFullPath("Output/Output" + i + ".jpg")))
2828
{
29-
//Copy the converted image stream into created output stream
3029
stream.CopyTo(fileStreamOutput);
3130
}
3231
}

PPTX-to-Image-conversion/Convert-PowerPoint-slide-to-Image/.NET/Convert-PowerPoint-slide-to-Image/Program.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
using Syncfusion.Presentation;
22
using Syncfusion.PresentationRenderer;
33

4-
//Load or open an PowerPoint Presentation.
4+
//Open an existing presentation.
55
using (FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
66
{
7-
//Open an existing PowerPoint presentation.
7+
//Load the presentation.
88
using (IPresentation pptxDoc = Presentation.Open(inputStream))
99
{
10-
//Initialize the PresentationRenderer to perform image conversion.
10+
//Initialize PresentationRenderer.
1111
pptxDoc.PresentationRenderer = new PresentationRenderer();
12-
//Convert the PowerPoint slide as an image stream .
12+
//Convert the PowerPoint slide as an image stream.
1313
using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg))
1414
{
15-
//Create the output image file stream.
15+
//Save the image stream to a file.
1616
using (FileStream fileStreamOutput = File.Create(Path.GetFullPath(@"Output/Output.jpg")))
1717
{
18-
//Copy the converted image stream into created output stream.
1918
stream.CopyTo(fileStreamOutput);
2019
}
2120
}

0 commit comments

Comments
 (0)