Add Picture to PowerPoint with C# REST API

Follow this guide to learn how to add picture to PowerPoint with C# REST API. You will learn how to add a picture to a PowerPoint with C# Low Code API using a .NET-based Cloud SDK. This article discusses various properties to customize the picture before adding it to the slide.

Prerequisite

Steps to Add Picture in PowerPoint with C# .NET-based API

  1. Instantiate the SlidesApi object to insert a picture in a slide
  2. Upload the target presentation file where the image is to be added
  3. Prepare the image data in the required format
  4. Create the PictureFrame object for placing in a slide
  5. Call the CreateShape method to insert the image into a specific slide
  6. Download the file after adding an image to it

These steps summarize how to add a picture to PowerPoint with C# REST Interface. Upload the source presentation to the Cloud storage, prepare the image using the ToBase64String() method in the Convert namespace, and use this image to create a PictureFrame object. Finally, call the CreateShape() method to add the picture to the specified slide and download the updated presentation.

Code for Adding Pictures to PowerPoint Slides with C# REST API

This sample code demonstrates how to put picture on PowerPoint with C# RESTful Service. You can define the starting position of the picture by setting the X and Y properties in the PictureFrame object, and define the picture-filling mode using the PictureFill class object. The PictureFrame property defines the size of the image on the slide irrespective of the original size.

This article has taught us to add pictures. To add notes to a presentation, refer to the article on Add notes to powerpoint slide with C# REST API.

 English