Hi,
We have been using Aspose Slides for .Net 3.5 client profile 6.9.0 dll inorder to create an OleObjectFrame in a Presentation(ppt)
Since some issues related to us have been fixed in release Aspose Slides for .Net 3.5 client profile 7.5.0 dll, we are using this latest dll(7.5.0).
However, we are unable to scale the size and position of OleObjectFrame with the below code which was working fine for the previous dll version 6.9.0
Sample Code:
//Main code - Start
Presentation pres = new Presentation();
Slide sld = pres.AddEmptySlide();
Presentation m_masterTemplate = new Presentation(@"C:\\AnswersWeb66\\ANSWERSWEB\\SOURCE\\AnswersWeb6.6\\Test\\Portal\\PPTTemplates\Master.ppt");
Bitmap imgchart = new System.Drawing.Bitmap(@"C:/temp/Image.jpg");
MemoryStream wbStream = new MemoryStream();
addOLEObjectFrame(wbStream, imgchart, pres, sld, 295, 1007, 4814, 2678);
//Cloning the master slide
Slide clonedSlide = m_masterTemplate.CloneSlide(m_masterTemplate.GetSlideByPosition(1),
pres.Slides.LastSlidePosition + 1, pres, new System.Collections.SortedList());
// Now m_show contains 1 extra slide (cloned) + 1 logo master from m_masterTemplate.
// Replace master for m_show own slides and then
// delete the slide (not master) which was cloned from m_masterTemplate.
Slide logoMaster = pres.GetSlideById(clonedSlide.MasterId);
foreach (Slide slide in pres.Slides)
slide.ChangeMaster(logoMaster);
pres.Slides.Remove(clonedSlide);
pres.DeleteUnusedMasters();
pres.Write(@"C:/temp/Output.ppt");
//Main code - End
//Method used within the main code
public void addOLEObjectFrame(MemoryStream wbStream, Bitmap imgChart, Presentation pres, Slide sld, int SlideLeft, int SlideTop, int SlideWidth, int SlideHeight)
{
Aspose.Slides.Picture pic = new Aspose.Slides.Picture(pres, imgChart);
int picId = pres.Pictures.Add(pic);
byte[] chartOleData = new byte[wbStream.Length];
wbStream.Position = 0;
wbStream.Read(chartOleData, 0, chartOleData.Length);
OleObjectFrame oof = sld.Shapes.AddOleObjectFrame(SlideLeft, SlideTop, SlideWidth, SlideHeight, "Excel.Sheet.8", chartOleData);
oof.PictureId = picId;
}
I have attached the required input files and the output obtained for Aspose Slides .Net version 6.9.0 dll and Aspose Slides .Net version 7.5.0dll
Please look into this issue with high priority and let us know if any workaround is present to scale and change the position of the OleObjectFrame.
Kindly let me know if you need any further details.
Thanks,
Koundinya