Hi
Using Spire.Presentation Pro Edition we are updating presentation (pptx) files and then converting it to from pptx to pdf . We are inserting a few chart images in our presentation which are not clear when added to pptx as per the standard we need . Below is the code attached and the files generated . Would appreciate help on having clear images in our presentation files .
public void insertImage(string presentationFile)
{
Spire.Presentation.Presentation presentation = new Presentation();
presentation.LoadFromFile(presentationFile);
string strChartImagePath = "image path";
string ImageFile = "BBchart.png";
string strImagePath = strChartImagePath + @"\" + ImageFile;
Bitmap oImg = new Bitmap(strImagePath);
RectangleF recto = new RectangleF(70, 425, oImg.Width , oImg.Height );
IEmbedImage shape = presentation.Slides[0].Shapes.AppendEmbedImage(ShapeType.Rectangle, strImagePath, recto);
shape.Line.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
shape.Line.SolidFillColor.Color = Color.FromArgb(107, 202, 186);
ImageFile = "PHPCchart.png";
strImagePath = strChartImagePath + @"\" + ImageFile;
oImg = new Bitmap(strImagePath);
RectangleF rect = new RectangleF(70, 200, oImg.Width, oImg.Height );
shape = presentation.Slides[1].Shapes.AppendEmbedImage(ShapeType.Rectangle, strImagePath, rect);
shape.Line.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
shape.Line.SolidFillColor.Color = Color.FromArgb(107, 202, 186);
oImg.Dispose(); oImg = null;
ImageFile = "PHPCGroupChart.png";
strImagePath = strChartImagePath + @"\" + ImageFile;
oImg = new Bitmap(strImagePath);
rect = new RectangleF(70, 475, oImg.Width, oImg.Height);
shape = presentation.Slides[1].Shapes.AppendEmbedImage(ShapeType.Rectangle, strImagePath, rect);
shape.Line.FillType = Spire.Presentation.Drawing.FillFormatType.Solid;
shape.Line.SolidFillColor.Color = Color.FromArgb(107, 202, 186);
oImg.Dispose(); oImg = null;
presentation.SaveToFile(presentationFile, FileFormat.Pptx2010);
}
public void PPTtoPDF(string srcFilePPT, string destinationFilePDF)
{
//create PPT document
Presentation presentation = new Presentation();
//load PPT file from disk
presentation.LoadFromFile(srcFilePPT);
//save the PPT do PDF file format
presentation.SaveToFile(destinationFilePDF, FileFormat.PDF);
System.Diagnostics.Process.Start(destinationFilePDF);
}