Dear Michael,
Thanks for your help.
There is a workaround to add a linked picture with external URL using Aspose.Slides feature namely Shape Serialization.
The idea is to import a linked PictureFrame from a source presentation to a target presentation using serialization and change the link path.
Please see the code below and also see the source.ppt and output.ppt generated by the code; which I have attached for your reference.
When you will open the output.ppt, it will display the Aspose Logo retrieving it from internet as shown in code.
C#
//Source presentation to get the linked picture from
Presentation srcPres = new Presentation("c:\\source.ppt");
//Source slide with a single shape which is a linked pictureframe
Slide srcSld = srcPres.GetSlideByPosition(1);
//Serialize the pictureframe
Shape shp = srcSld.Shapes[0];
MemoryStream ms = new MemoryStream();
shp.Serialize(ms);
//Now once serialized, we can import into our target presentation
//Create a target presentation
Presentation target = new Presentation();
Slide targetSld = target.GetSlideByPosition(1);
//Import the serialized shape
ms.Position = 0;
targetSld.Shapes.Add(ms);
//Access the shape as a pictureframe
PictureFrame pf = targetSld.Shapes[0] as PictureFrame;
//Change its link path
pf.PictureFileName = "http://www.aspose.com/Images/aspose-logo.jpg";
//Write the target presentation on disk.
target.Write("c:\\output.ppt");
Many Thanks and Kind Regards,
Shakeel Faiz
Support Developer
Aspose Sialkot Team
Contact UsAspose - The .NET and Java Component Publisher
Keep in touch! We're on
Twitter and
Facebook