@Rohan_Wankar,
Please share the final code sample you are currently on, the presentation file, and describe what is wrong with it now. We will then check the problem soon.
Hi! @Andrey_Potapov
I am using the same snippet code that I shared today.
One thought on this.
After creating worksheet we are setting ImageOrPrintOptions and we are getting as byte[] imageByteArray
oof.getSubstitutePictureFormat().getPicture()
.setImage(presentation.getImages().addImage(imageByteArray));
Do we have the provision to set the image height & width in
IPictureFillFormat pictureFillFormat = oof.getSubstitutePictureFormat()
thanks!
@Rohan_Wankar,
Once you’ve created the OLE object of the size you need with Aspose.Cells, you can add it to your presentation in the center of the slide like this:
...
Presentation pres = new Presentation();
ISlide sld = pres.getSlides().get_Item(0);
Dimension2D slideSize = pres.getSlideSize().getSize();
// Your calculated size, only for example
float oleObjectWidth = 400;
float oleObjectHeight = 250;
float oleObjectX = (float) (slideSize.getWidth() - oleObjectWidth) / 2;
float oleObjectY = (float) (slideSize.getHeight() - oleObjectHeight) / 2;
// Add the workbook to the slide
IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(bout.toByteArray(), "xlsx");
IOleObjectFrame oof = sld.getShapes().addOleObjectFrame(
oleObjectX, oleObjectY, oleObjectWidth, oleObjectHeight, dataInfo);
...
Please also note that each Presentation object is disposable. You should call the dispose()
method after the Presentation
object is no longer needed in your production code.
Hi! @Amjad_Sahi
Can you share me the snippet code for generating the image using aspose image API?
on the same.
Please post you query in Aspose.Imaging forum and one of our fellow colleagues from Aspose.Imaging team will assist you soon.
Hi! @Amjad_Sahi
I have posted the question in aspose image forum.
I have posted the response from aspose image.
image.png (34.4 KB)
Could let me know is it possible?
thanks!
Rohan
Aspose.Cells does not use Aspose.Imaging API. Similar is the case with Aspose.Imaging API which does not use Aspose.Cells API. To maniulate images, you have to use Aspose.Imaging or other image processing library to manipulate images for your requirements. I guess after you have rendered worksheet’s image via Aspose.Cells API, you may then use Aspose.Imaging API to further manipulate/update it accordingly.