Hi
I am evaluating upgrading our existing automation project where create a power point presentation from a series of images and/or text. I am using powerpoint for 2013.
I have a working version for emf files and i am happy with quality of the images in the ppt file created.
We are using a large number of fairly large images and i would like to use a compressed zip emf so they size of the presentation and any pdfs generated from it are reduced in size but not quality.
below is my code example …
protected void AddPicture(IPresentation p, ISlide s, byte[] data, float x, float y, float width, float height)
{
if (s != null)
{
if (s.Shapes != null)
{
IPPImage imgx = p.Images.AddImage(data);
var m = s.Shapes.AddPictureFrame(ShapeType.Rectangle, x, y, width, height, imgx);
}
}
}
private byte[] GetCompressedData(string fileNameZip, byte[] buffer)
{
byte[] bufferZip = null;
using (FileStream f = new FileStream(fileNameZip, FileMode.Create))
{
using (var gz = new GZipStream(f, CompressionMode.Compress, false))
{
gz.Write(buffer, 0, buffer.Length);
}
}
using (FileStream f = new FileStream(fileNameZip, FileMode.Open))
{
bufferZip = new byte[f.Length];
f.Read(bufferZip, 0, (int)f.Length);
}
return bufferZip;
}
it works fine for emf files.
emf files.zip (191.9 KB)
I would like to compress the data via std gzip compression in c# and pass in the data related to the emz file.
I have tested that power point can manually add a picture from the emz file that i generate.
Can you let me know if this is possible and/or if this can be added?
regards,
Zoran