Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Jun 29, 2022 6:57 pm

I foundthe tutorial of how to insert image to placeholder, but it supports the insertion of only files from local file system.
Is there any way to insert image using URl, like how it works here:
Code: Select all
shape.Fill.PictureFill.Picture.Url = picUrl;


thanks

yarchiT2022
 
Posts: 5
Joined: Wed Jun 29, 2022 6:52 pm

Thu Jun 30, 2022 9:34 am

Hello,

Thanks for your inquiry.

Sorry that Spire.Presentation does not support inserting online pictures. The "Url" in code "shape.Fill.PictureFill.Picture.Url" refers to the local path of the pictures instead of online url.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Thu Jun 30, 2022 10:51 am

Thanks for a fast response.

Is there any way you can recommend placing an online image into a slide into a defined rectangle? So the image would be cropped if needed?
Basically same as with placeholder, but maybe there is some other way?

thanks

yarchiT2022
 
Posts: 5
Joined: Wed Jun 29, 2022 6:52 pm

Thu Jun 30, 2022 11:41 am

And I just re-read your response, and actually Spire.Presentation supports setting online pictures. For example, in
Code: Select all
shape.Fill.PictureFill.Picture.Url = picUrl;


picUrl can be image from online. I'm just asking if there is any way to crop the image to selected shape, not just Stretch it.

yarchiT2022
 
Posts: 5
Joined: Wed Jun 29, 2022 6:52 pm

Thu Jun 30, 2022 1:47 pm

Or would it be possible to add Image to placeholder from Stream?

Inside the InsertPicture method I see that you add ImageData to Placeholder internally. I can create ImageData from stream, but I can't ImageData to Placeholder using current interface.

yarchiT2022
 
Posts: 5
Joined: Wed Jun 29, 2022 6:52 pm

Fri Jul 01, 2022 10:11 am

Hi,

Thanks for your reply.

Please kindly note that in the code "shape.Fill.PictureFill.Picture.Url = picUrl", the parameter picUrl should be a local image path instead of an online image url. If you use the online image url, you will encounter an error when you open the result PPTX file.
For cropping pictures, we have implemented it in Spire.Presentation for Java. We'll be syncing it to Spire.Presentation for .NET soon.
For streaming pictures, I've added it to our new features list with the ticket SPIREPPT-1984. We'll add an overload for the InsertPicture method to meet this requirement. I will keep you informed of any updates to the above two issues.
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.Presentation