Free Support Forum - groupdocs.com

How to add PDF OLE object into PPTX file using .NET

Hi,

We try to add pdf ole object into power point.
It’s working with below sample code when powerpoint file format is “ppt” but ‘pptx’.
May I know how to add pdf ole object into pptx file? Thanks.

<C# sample code here:>-----------------------------------------------------------
OlePresentationOptions olePresentationOptions = new OlePresentationOptions(@“embedded.pdf”, pageNumber)
{
X = 10, // Setting only X & Y coordinates, you can customize more.
Y = 10,
Width = 50,
Height = 50
};
// Using Merger class to embed a PDF file as an OLE object in the PowerPoint presentation.
//using (Merger merger = new Merger(@“sample-presentation.ppt”))
using (Merger merger = new Merger(@“sample-presentation.pptx”)) //Fail when using pptx
{
merger.ImportDocument(olePresentationOptions);
//merger.Save(@“powerpoint-presentation-with-ole.ppt”);
merger.Save(@“powerpoint-presentation-with-ole.pptx”); //Fail when using pptx
}
-------------------------------------------------------------------------------------------------

1 Like

@felixjian

We cannot reproduce this issue at our end using sample PPTX and PDF. Could you please share following details and we’ll further look into it:

  • API version that you are using (e.g. 20.12, 21.2)
  • Problematic PPTX and PDF

Hi Atir_Tahir,

Thanks for your reply.
I’m sorry for my mistake with incorrect PPTX that cause the problem.
The symptom is solved. It’s working with Lib API (version 21.2.0.0) in my case.

Another question:
Is any way to modify ole object name/picture for display?

Thanks
Felix

1 Like

@felixjian

Do you mean changing the details within outlined area in this screenshot.PNG (30.5 KB)?

Hi Atir_Tahir,

Yes, It’s. thanks.

Felix

1 Like

@felixjian

We’re investigating the possibility to change name/picture of the OLE object in the resultant file. Your investigation ticket ID is MERGERNET-1075. We’ll notify you in case of any update.

Hi Atir_Tahir,

Thanks for your support. Hope can get your feedback soon.

Thanks
Felix

@felixjian

We investigated this scenario. But there is no possibility to alter the image/text of the OLE object. However, we have created another ticket MERGERNET-1076. But we cannot share any ETA at the moment.

Hi Atir_Tahir,

Got it. thanks.

Felix

1 Like

@felixjian

You’re welcome.