Insert Image into PDF with C# REST API

In this fast‑track tutorial you’ll discover how to insert an image into a PDF using the C# REST API. We’ll walk you through programmatically adding a picture to a PDF document with the C# .NET‑based API via the cloud SDK. You’ll learn to upload images and PDF files, set the image’s position, and specify the target page number.

Prerequisite

Steps to Insert a Picture in a PDF with C# REST Interface

  1. Configure the PdfApi class object for adding an image to a PDF
  2. Upload the target PDF file to the Cloud Storage with a specified name
  3. Upload the image file to the Cloud storage and assign it a name
  4. Call the PostInsertImage() method by providing the names of the PDF file, image, page number, and rectangular area
  5. Download the updated PDF file and save it on the disk

These steps summarize how to insert picture in PDF document with C# .NET-based API. Upload the source PDF file, and image, and define the rectangular area describing the position and dimension of the image. Check the status of the response and download the updated PDF file having the new image in it.

Code to Insert an Image in PDF with C# .NET-based API

With this code you can easily insert an image into a PDF using a C# RESTful service. Remember that the first page is referenced with page index 1 (not 0), define the rectangle relative to the page’s bottom‑left corner, and specify the height and width in points.

Now you’ve mastered inserting an image into a PDF with the C# REST API. If you’d like to learn how to add an entire page, see our guide on how to Add New Page in PDF with C# REST API.

 English