Skip to content

Commit

Permalink
Updated GitHub for FT samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Suresh-Maran21 committed Nov 28, 2024
1 parent 383c812 commit f4d4964
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ static void Main(string[] args)
//Open the existing PowerPoint presentation.
using (IPresentation pptxDoc = Presentation.Open(fileStream))
{
//Initialize the PresentationRenderer to perform image conversion.
//Initialize PresentationRenderer.
pptxDoc.PresentationRenderer = new PresentationRenderer();
//Convert PowerPoint to image as stream.
Stream[] images = pptxDoc.RenderAsImages(ExportImageFormat.Jpeg);
//Saves the images to file system
//Save the images to file.
for (int i = 0; i < images.Length; i++)
{
using (Stream stream = images[i])
{
//Create the output image file stream
//Save the image stream to a file.
using (FileStream fileStreamOutput = File.Create(Path.GetFullPath("Output/Output" + i + ".jpg")))
{
//Copy the converted image stream into created output stream
stream.CopyTo(fileStreamOutput);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
using Syncfusion.Presentation;
using Syncfusion.PresentationRenderer;

//Load or open an PowerPoint Presentation.
//Open an existing presentation.
using (FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
//Open an existing PowerPoint presentation.
//Load the presentation.
using (IPresentation pptxDoc = Presentation.Open(inputStream))
{
//Initialize the PresentationRenderer to perform image conversion.
//Initialize PresentationRenderer.
pptxDoc.PresentationRenderer = new PresentationRenderer();
//Convert the PowerPoint slide as an image stream .
//Convert the PowerPoint slide as an image stream.
using (Stream stream = pptxDoc.Slides[0].ConvertToImage(ExportImageFormat.Jpeg))
{
//Create the output image file stream.
//Save the image stream to a file.
using (FileStream fileStreamOutput = File.Create(Path.GetFullPath(@"Output/Output.jpg")))
{
//Copy the converted image stream into created output stream.
stream.CopyTo(fileStreamOutput);
}
}
Expand Down

0 comments on commit f4d4964

Please sign in to comment.