Visible Content after Adding Embedded Object in PowerPoint Presentation in Java

Hi Team I am trying to embedded a file to be specific a .prism file in PPT. I am using below code

Path path = Paths.get(filePath);
byte[] data = Files.readAllBytes(path);
IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(data, ".prism");
IOleObjectFrame objectFrame = sld.getShapes().insertOleObjectFrame(0, 100f, 100f, (float) oleWidth, (float) oleHeight, dataInfo);

After execution its adding object in Slide as Below
Ebd.png (30.5 KB)

and after clicking it its opening correctly in the tool, but after that its appearing as below in Slides
Ebd_After.png (3.2 KB)

But i want its content to be visible like below, Like how its how when we copy paste it as content on normal ppt creation.
Ebd_WithContent.png (5.2 KB)

Please help.

@mdmobin,
Thank you for contacting support.

I believe that when you copy and paste content from the document onto a slide, an image is created. To make the content visible in place of the OLE object, you should somehow create a preview image and insert it in place of the icon image like this:

byte[] imageData = Files.readAllBytes(Paths.get("preview_image.png"));
IPPImage oleImage = presentation.getImages().addImage(imageData);

objectFrame.getSubstitutePictureFormat().getPicture().setImage(oleImage);
objectFrame.setObjectIcon(false);

More examples:

Thanks for the update team, is there no way other than setting image explicitly ?

@mdmobin,
Unfortunately, PowerPoint documents do not provide another way.

hi @andrey.potapov
After Adding object like above , when PPT is generated it shows as whatever image we have added as below
Ebd_Generated.png (18.7 KB)

, but after opening the file , its getting changed to icon again like below.
Ebd_After.png (3.2 KB)

I have set the objectFrame.setObjectIcon(false); as well
Please help

@mdmobin,
When you create an OleEmbeddedDataInfo object, you should pass the “prism” string to the embeddedFileExtension parameter instead of “.prism”:

IOleEmbeddedDataInfo dataInfo = new OleEmbeddedDataInfo(data, "prism");

Hi @andrey.potapov apologies for previous confusion i am using prism only i meant without dot

@mdmobin,
Thank you for the additional information. I am working on the issue and will get back to you soon.

Hi Team / @andrey.potapov
Please provide an update, Please note that we are doing POC, and we are checking the feasibility to do these things in Aspose, based on output of POC we will consider to buy the license, currently we are using temp license .

@mdmobin,
Thank you for your patience. Unfortunately, I was unable to reproduce the problem you described. Please check your results using the latest version of Aspose.Slides for Java if possible. If the issue persists, please share the following files and information:

  • sample presentation file (if you used it)
  • sample PRISM file
  • complete code example
  • output presentation file
  • OS version on which the code was executed
  • JDK version in your app
  • Aspose.Slides version you used
  • application name and version to open PRISM files
  • version of PowerPoint in which we can see the problem

HI @andrey.potapov,
i have tested with version 23.12, issue still persist Please see below and in the attchment as requested

Aspose.zip (139.6 KB)

  • sample presentation file (if you used it) : BlankPPT_Input.pptx inside zip file
  • sample PRISM file : SamplePrism.prism inside zip file
  • complete code example : inside Code folder inside zip file
  • output presentation file : SamplePrism.prism inside zip file
  • OS version on which the code was executed : Microsoft Windows 11 Pro (10.0.22621 Build 22621)
  • JDK version in your app : Java 11
  • Aspose.Slides version you used 23.12
  • application name and version to open PRISM files : Graph Pad Prism 10.1.2
  • version of PowerPoint in which we can see the problem: Version 2312 (Build 16.0.17126.20126)

Please help ASAP.
Is there any facility to connect over call and resolve the issue ?

@mdmobin,
Thank you for the details. I am working on the issue and will get back to you soon.

We provide free support on this forum, but you can contact Paid Support Team to increase the priority of the issue.

hi @andrey.potapov ,
Any update on above issue.

@mdmobin,
I am working on the issue and will get back to you soon. Thank you for your patience.

@mdmobin,
Thank you for your patience again. I’ve reproduced the problem you described.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39384

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

hi @andrey.potapov ,
Any Update on my tickets, Is there any ETA for this.

@mdmobin,
I’ve requested ETA for the issue from our development team for you. We will let you know soon.

Hi @andrey.potapov , Please provide an update. Please note that We are in temp License and we will buy based on feasibility of POC we are doing. If it take times resolve, We might have to look for another ways and libraries.

@mdmobin,
Our developers will investigate the case next week. We really appreciate you using our products. Thank you for your patience.

hi @andrey.potapov ,
Any update on the ticket.