I am using following psuedo code for converting pptx to jpg/png.
but when it got completed, the jpg/png file generated having different font and slightly different style from original pptx.
1. pptx file
2. Amatil Fuze screen.jpg (with mismatched fonts and style)
3. Amatil Fuze screen1.jpg (actual image should be like this)
using (Presentation pres = new Presentation(file.InputStream))
{
for (int i = 0; i < pres.Slides.Count; i++)
{
//Access the first slide
ISlide sld = pres.Slides[i];
//User defined dimension
int desiredX = 1920;
int desiredY = 1440;
//Getting scaled value of X and Y
float ScaleX = (float)(1.0 / pres.SlideSize.Size.Width) * desiredX;
float ScaleY = (float)(1.0 / pres.SlideSize.Size.Height) * desiredY;
//Create a full scale image
Bitmap bigImage = sld.GetThumbnail(ScaleX, ScaleY);
string outputFileName = string.Format(targetFile, maxSlideIndex + i + 1);
DeleteFile(outputFileName);
//Save the image to disk in PNG format
bigImage.Save(outputFileName, ImageFormat.Png);
//Removing white border
using (Bitmap bmpImage = new Bitmap(outputFileName))
{
System.Drawing.Rectangle cropArea = new System.Drawing.Rectangle(1, 1, bmpImage.Width - 1, bmpImage.Height - 1);
resize = new Bitmap(bmpImage);
resize = resize.Clone(cropArea, bmpImage.PixelFormat);
}
//Saving as JPEG
resize.Save(outputFileName, ImageFormat.Jpeg);
resize.Dispose();
int slideIndexId = maxSlideIndex + i + 1;
story.Slides.Add(new StorySlide() { SlideIndex = slideIndexId, Type = “JPG”, IsCoverPage = slideIndexId == 0 ? true : false, CategoryId = 0, Calculations = string.Empty, leaf = true, Title = string.Empty, Question = string.Empty });
}
story.Save();
}