This tutorial guides how to add circle to PDF with C# REST API. You will learn to automatically draw a circle on a PDF with C# .NET-based API using a .NET-based Cloud SDK. It will also provide details to customize the circle according to your needs.
Prerequisite
- Create an account API credentials
- Download Aspose.PDF Cloud SDK for Dotnet to add a circle in a PDF file
- Setup C# project with the above SDK for working with circle annotations
Steps to Draw Circle in PDF with C# REST Interface
- Configure the PdfApi class object by setting the API and application details
- Create the CircleAnnotation object and set the rectangular area for the circle and color
- Set the modified and creation dates as these are mandatory
- Upload the target PDF file to the Cloud storage for adding a circle
- Call the PostPageCircleAnnotations() method to draw the circle in the given rectangle
- Download the updated PDF file with the circle in it
These steps describe how to insert circle in PDF with C# REST API. The CircleAnnotation is the main object that defines the format of the circle such as its dimensions, location, and color, etc. Upload the target PDF file to the Cloud storage, set the creation and modification dates, and call the PostPageCircleAnnotations() method to draw the circle.
Code to Add Circle in PDF with C# RESTful Service
This code has demonstrated the process of how to add a circle to a PDF with C# Low Code API. You may repeat this process by drawing multiple circles on the same page or drawing circles on multiple pages using different page numbers in the PostPageCircleAnnotations() method. Only one call to the PostPageCircleAnnotations() method can draw multiple circles as it takes a list of annotations where more than one entry can be added.
This article has taught us to draw a circle on a PDF. If you want to highlight some portion of a PDF page, refer to the article on Highlight PDF Document with C# REST API.