We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Size of OleObject Added to PPT with Aspose.Slides

Hi,
I am trying to load an excel object that Iedit using Aspose.Cells to a PPT presentation using Aspose.Slides.
the problem is that the size of the added object is very small, and it looks bad on the slide.
Code:
Shape shape = slide.getShapes().get(index);
OleObjectFrame oof = (OleObjectFrame) shape;
if (oof != null){
try {
byte[] buf = oof.getObjectData();
InputStream is = new ByteArrayInputStream(buf);
.
.
//Here there is a code where I edit the Excel using AsposeCells
//and save it to output stream named os
.
.
oof.setObjectData(os.toByteArray());
.
.
//save the presentation

If I look at the shape->Format Object->Size- the Original Size is :
in the template file: 4.79x8.68
in the output file: 1.78x4.68

can this value be set by code? why is the OleObject shrinks?

Thanks in advance for the help!
Ido


You need to use SetOleSize method of Aspose.Cells properly.

For example, if your chart spans 12 columns and 6 rows, you will pass parameters

SetOleSize(1,12,1,6), then it will look normal size


But if you accidentally passed it SetOleSize(1,40, 1,50), it will look shrinked. So only pass that much columns and rows as much occupied by the chart in excel sheet.


Please see this post

https://forum.aspose.com/t/106224

Start reading from post 71911

https://forum.aspose.com/t/106224

Hi,
Thanks for the quick reply.
In which version can I find the SetOleSize function?
I am using version 1.9.5, and I also tried 2.0.
I dont have it in the WorkSheets object.
Can you guide me to this function? I cant seem to find it in the API reference.
BTW, I am using java 1.4
Thanks again,
Ido

I see now that the function exists in the .NET version, but not in the java version.
Can this feature be added?
Thanks,
Ido

Dear Ido,

Please follow this thread; I have posted your question to Aspose.Cells forum.